Skip to content

Commit 0603006

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "This is seven basic fixes (plus one MAINTAINER update) which came in close to the merge window" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: ipr: Fix error return code in ipr_probe_ioa() fcoe: add missing destroy_workqueue() on error in fcoe_init() lpfc: Fix possible NULL pointer dereference fcoe: Use default VLAN for FIP VLAN discovery ipr: Wait to do async scan until scsi host is initialized MAINTAINERS: Update cxlflash maintainers cxlflash: Verify problem state area is mapped before notifying shutdown lpfc: fix oops in lpfc_sli4_scmd_to_wqidx_distr() from lpfc_send_taskmgmt()
2 parents d268675 + c8e18ac commit 0603006

File tree

8 files changed

+79
-13
lines changed

8 files changed

+79
-13
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,6 +3494,7 @@ F: Documentation/ABI/testing/sysfs-class-cxl
34943494
CXLFLASH (IBM Coherent Accelerator Processor Interface CAPI Flash) SCSI DRIVER
34953495
M: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
34963496
M: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
3497+
M: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
34973498
L: linux-scsi@vger.kernel.org
34983499
S: Supported
34993500
F: drivers/scsi/cxlflash/

drivers/scsi/cxlflash/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ static void notify_shutdown(struct cxlflash_cfg *cfg, bool wait)
778778
{
779779
struct afu *afu = cfg->afu;
780780
struct device *dev = &cfg->dev->dev;
781-
struct sisl_global_map __iomem *global = &afu->afu_map->global;
781+
struct sisl_global_map __iomem *global;
782782
struct dev_dependent_vals *ddv;
783783
u64 reg, status;
784784
int i, retry_cnt = 0;
@@ -787,6 +787,14 @@ static void notify_shutdown(struct cxlflash_cfg *cfg, bool wait)
787787
if (!(ddv->flags & CXLFLASH_NOTIFY_SHUTDOWN))
788788
return;
789789

790+
if (!afu || !afu->afu_map) {
791+
dev_dbg(dev, "%s: The problem state area is not mapped\n",
792+
__func__);
793+
return;
794+
}
795+
796+
global = &afu->afu_map->global;
797+
790798
/* Notify AFU */
791799
for (i = 0; i < NUM_FC_PORTS; i++) {
792800
reg = readq_be(&global->fc_regs[i][FC_CONFIG2 / 8]);

drivers/scsi/fcoe/fcoe.c

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ static struct fcoe_interface
9292

9393
static int fcoe_fip_recv(struct sk_buff *, struct net_device *,
9494
struct packet_type *, struct net_device *);
95+
static int fcoe_fip_vlan_recv(struct sk_buff *, struct net_device *,
96+
struct packet_type *, struct net_device *);
9597

9698
static void fcoe_fip_send(struct fcoe_ctlr *, struct sk_buff *);
9799
static void fcoe_update_src_mac(struct fc_lport *, u8 *);
@@ -363,6 +365,12 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
363365
fcoe->fip_packet_type.dev = netdev;
364366
dev_add_pack(&fcoe->fip_packet_type);
365367

368+
if (netdev != real_dev) {
369+
fcoe->fip_vlan_packet_type.func = fcoe_fip_vlan_recv;
370+
fcoe->fip_vlan_packet_type.type = htons(ETH_P_FIP);
371+
fcoe->fip_vlan_packet_type.dev = real_dev;
372+
dev_add_pack(&fcoe->fip_vlan_packet_type);
373+
}
366374
return 0;
367375
}
368376

@@ -450,6 +458,8 @@ static void fcoe_interface_remove(struct fcoe_interface *fcoe)
450458
*/
451459
__dev_remove_pack(&fcoe->fcoe_packet_type);
452460
__dev_remove_pack(&fcoe->fip_packet_type);
461+
if (netdev != fcoe->realdev)
462+
__dev_remove_pack(&fcoe->fip_vlan_packet_type);
453463
synchronize_net();
454464

455465
/* Delete secondary MAC addresses */
@@ -519,6 +529,29 @@ static int fcoe_fip_recv(struct sk_buff *skb, struct net_device *netdev,
519529
return 0;
520530
}
521531

532+
/**
533+
* fcoe_fip_vlan_recv() - Handler for received FIP VLAN discovery frames
534+
* @skb: The receive skb
535+
* @netdev: The associated net device
536+
* @ptype: The packet_type structure which was used to register this handler
537+
* @orig_dev: The original net_device the the skb was received on.
538+
* (in case dev is a bond)
539+
*
540+
* Returns: 0 for success
541+
*/
542+
static int fcoe_fip_vlan_recv(struct sk_buff *skb, struct net_device *netdev,
543+
struct packet_type *ptype,
544+
struct net_device *orig_dev)
545+
{
546+
struct fcoe_interface *fcoe;
547+
struct fcoe_ctlr *ctlr;
548+
549+
fcoe = container_of(ptype, struct fcoe_interface, fip_vlan_packet_type);
550+
ctlr = fcoe_to_ctlr(fcoe);
551+
fcoe_ctlr_recv(ctlr, skb);
552+
return 0;
553+
}
554+
522555
/**
523556
* fcoe_port_send() - Send an Ethernet-encapsulated FIP/FCoE frame
524557
* @port: The FCoE port
@@ -539,7 +572,21 @@ static void fcoe_port_send(struct fcoe_port *port, struct sk_buff *skb)
539572
*/
540573
static void fcoe_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb)
541574
{
542-
skb->dev = fcoe_from_ctlr(fip)->netdev;
575+
struct fcoe_interface *fcoe = fcoe_from_ctlr(fip);
576+
struct fip_frame {
577+
struct ethhdr eth;
578+
struct fip_header fip;
579+
} __packed *frame;
580+
581+
/*
582+
* Use default VLAN for FIP VLAN discovery protocol
583+
*/
584+
frame = (struct fip_frame *)skb->data;
585+
if (frame->fip.fip_op == ntohs(FIP_OP_VLAN) &&
586+
fcoe->realdev != fcoe->netdev)
587+
skb->dev = fcoe->realdev;
588+
else
589+
skb->dev = fcoe->netdev;
543590
fcoe_port_send(lport_priv(fip->lp), skb);
544591
}
545592

@@ -2448,7 +2495,7 @@ static int __init fcoe_init(void)
24482495
if (rc) {
24492496
printk(KERN_ERR "failed to register an fcoe transport, check "
24502497
"if libfcoe is loaded\n");
2451-
return rc;
2498+
goto out_destroy;
24522499
}
24532500

24542501
mutex_lock(&fcoe_config_mutex);
@@ -2471,6 +2518,7 @@ static int __init fcoe_init(void)
24712518

24722519
out_free:
24732520
mutex_unlock(&fcoe_config_mutex);
2521+
out_destroy:
24742522
destroy_workqueue(fcoe_wq);
24752523
return rc;
24762524
}

drivers/scsi/fcoe/fcoe.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ struct fcoe_interface {
8080
struct net_device *realdev;
8181
struct packet_type fcoe_packet_type;
8282
struct packet_type fip_packet_type;
83+
struct packet_type fip_vlan_packet_type;
8384
struct fc_exch_mgr *oem;
8485
u8 removed;
8586
u8 priority;

drivers/scsi/ipr.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,6 +3288,11 @@ static void ipr_worker_thread(struct work_struct *work)
32883288
return;
32893289
}
32903290

3291+
if (!ioa_cfg->scan_enabled) {
3292+
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
3293+
return;
3294+
}
3295+
32913296
restart:
32923297
do {
32933298
did_work = 0;
@@ -10214,6 +10219,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
1021410219

1021510220
if (!ioa_cfg->reset_work_q) {
1021610221
dev_err(&pdev->dev, "Couldn't register reset workqueue\n");
10222+
rc = -ENOMEM;
1021710223
goto out_free_irq;
1021810224
}
1021910225
} else
@@ -10362,6 +10368,7 @@ static void ipr_remove(struct pci_dev *pdev)
1036210368
static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
1036310369
{
1036410370
struct ipr_ioa_cfg *ioa_cfg;
10371+
unsigned long flags;
1036510372
int rc, i;
1036610373

1036710374
rc = ipr_probe_ioa(pdev, dev_id);
@@ -10414,7 +10421,10 @@ static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
1041410421
}
1041510422
}
1041610423

10424+
spin_lock_irqsave(ioa_cfg->host->host_lock, flags);
10425+
ioa_cfg->scan_enabled = 1;
1041710426
schedule_work(&ioa_cfg->work_q);
10427+
spin_unlock_irqrestore(ioa_cfg->host->host_lock, flags);
1041810428
return 0;
1041910429
}
1042010430

drivers/scsi/ipr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,7 @@ struct ipr_ioa_cfg {
14781478
u8 in_ioa_bringdown:1;
14791479
u8 ioa_unit_checked:1;
14801480
u8 dump_taken:1;
1481+
u8 scan_enabled:1;
14811482
u8 scan_done:1;
14821483
u8 needs_hard_reset:1;
14831484
u8 dual_raid:1;

drivers/scsi/lpfc/lpfc_scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3877,7 +3877,7 @@ int lpfc_sli4_scmd_to_wqidx_distr(struct lpfc_hba *phba,
38773877
uint32_t tag;
38783878
uint16_t hwq;
38793879

3880-
if (shost_use_blk_mq(cmnd->device->host)) {
3880+
if (cmnd && shost_use_blk_mq(cmnd->device->host)) {
38813881
tag = blk_mq_unique_tag(cmnd->request);
38823882
hwq = blk_mq_unique_tag_to_hwq(tag);
38833883

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,21 +1323,18 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
13231323
{
13241324
lockdep_assert_held(&phba->hbalock);
13251325

1326+
BUG_ON(!piocb || !piocb->vport);
1327+
13261328
list_add_tail(&piocb->list, &pring->txcmplq);
13271329
piocb->iocb_flag |= LPFC_IO_ON_TXCMPLQ;
13281330

13291331
if ((unlikely(pring->ringno == LPFC_ELS_RING)) &&
13301332
(piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) &&
13311333
(piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) &&
1332-
(!(piocb->vport->load_flag & FC_UNLOADING))) {
1333-
if (!piocb->vport)
1334-
BUG();
1335-
else
1336-
mod_timer(&piocb->vport->els_tmofunc,
1337-
jiffies +
1338-
msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
1339-
}
1340-
1334+
(!(piocb->vport->load_flag & FC_UNLOADING)))
1335+
mod_timer(&piocb->vport->els_tmofunc,
1336+
jiffies +
1337+
msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
13411338

13421339
return 0;
13431340
}

0 commit comments

Comments
 (0)