Skip to content

Commit 977fe77

Browse files
gonzoleemanmartinkpetersen
authored andcommitted
scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock"
This reverts commit 1a19755. This commit causes interrupts to be lost for FCoE devices, since it changed sping locks from "bh" to "irqsave". Instead, a work queue should be used, and will be addressed in a separate commit. Fixes: 1a19755 ("scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock") Signed-off-by: Lee Duncan <lduncan@suse.com> Link: https://lore.kernel.org/r/c578cdcd46b60470535c4c4a953e6a1feca0dffd.1707500786.git.lduncan@suse.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 4cbec7e commit 977fe77

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

drivers/scsi/fcoe/fcoe_ctlr.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,17 +319,16 @@ static void fcoe_ctlr_announce(struct fcoe_ctlr *fip)
319319
{
320320
struct fcoe_fcf *sel;
321321
struct fcoe_fcf *fcf;
322-
unsigned long flags;
323322

324323
mutex_lock(&fip->ctlr_mutex);
325-
spin_lock_irqsave(&fip->ctlr_lock, flags);
324+
spin_lock_bh(&fip->ctlr_lock);
326325

327326
kfree_skb(fip->flogi_req);
328327
fip->flogi_req = NULL;
329328
list_for_each_entry(fcf, &fip->fcfs, list)
330329
fcf->flogi_sent = 0;
331330

332-
spin_unlock_irqrestore(&fip->ctlr_lock, flags);
331+
spin_unlock_bh(&fip->ctlr_lock);
333332
sel = fip->sel_fcf;
334333

335334
if (sel && ether_addr_equal(sel->fcf_mac, fip->dest_addr))
@@ -700,7 +699,6 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport,
700699
{
701700
struct fc_frame *fp;
702701
struct fc_frame_header *fh;
703-
unsigned long flags;
704702
u16 old_xid;
705703
u8 op;
706704
u8 mac[ETH_ALEN];
@@ -734,11 +732,11 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport,
734732
op = FIP_DT_FLOGI;
735733
if (fip->mode == FIP_MODE_VN2VN)
736734
break;
737-
spin_lock_irqsave(&fip->ctlr_lock, flags);
735+
spin_lock_bh(&fip->ctlr_lock);
738736
kfree_skb(fip->flogi_req);
739737
fip->flogi_req = skb;
740738
fip->flogi_req_send = 1;
741-
spin_unlock_irqrestore(&fip->ctlr_lock, flags);
739+
spin_unlock_bh(&fip->ctlr_lock);
742740
schedule_work(&fip->timer_work);
743741
return -EINPROGRESS;
744742
case ELS_FDISC:
@@ -1707,11 +1705,10 @@ static int fcoe_ctlr_flogi_send_locked(struct fcoe_ctlr *fip)
17071705
static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
17081706
{
17091707
struct fcoe_fcf *fcf;
1710-
unsigned long flags;
17111708
int error;
17121709

17131710
mutex_lock(&fip->ctlr_mutex);
1714-
spin_lock_irqsave(&fip->ctlr_lock, flags);
1711+
spin_lock_bh(&fip->ctlr_lock);
17151712
LIBFCOE_FIP_DBG(fip, "re-sending FLOGI - reselect\n");
17161713
fcf = fcoe_ctlr_select(fip);
17171714
if (!fcf || fcf->flogi_sent) {
@@ -1722,7 +1719,7 @@ static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
17221719
fcoe_ctlr_solicit(fip, NULL);
17231720
error = fcoe_ctlr_flogi_send_locked(fip);
17241721
}
1725-
spin_unlock_irqrestore(&fip->ctlr_lock, flags);
1722+
spin_unlock_bh(&fip->ctlr_lock);
17261723
mutex_unlock(&fip->ctlr_mutex);
17271724
return error;
17281725
}
@@ -1739,9 +1736,8 @@ static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
17391736
static void fcoe_ctlr_flogi_send(struct fcoe_ctlr *fip)
17401737
{
17411738
struct fcoe_fcf *fcf;
1742-
unsigned long flags;
17431739

1744-
spin_lock_irqsave(&fip->ctlr_lock, flags);
1740+
spin_lock_bh(&fip->ctlr_lock);
17451741
fcf = fip->sel_fcf;
17461742
if (!fcf || !fip->flogi_req_send)
17471743
goto unlock;
@@ -1768,7 +1764,7 @@ static void fcoe_ctlr_flogi_send(struct fcoe_ctlr *fip)
17681764
} else /* XXX */
17691765
LIBFCOE_FIP_DBG(fip, "No FCF selected - defer send\n");
17701766
unlock:
1771-
spin_unlock_irqrestore(&fip->ctlr_lock, flags);
1767+
spin_unlock_bh(&fip->ctlr_lock);
17721768
}
17731769

17741770
/**

0 commit comments

Comments
 (0)