scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock"
commit 977fe773dcc7098d8eaf4ee6382cb51e13e784cb upstream.
This reverts commit 1a1975551943f681772720f639ff42fbaa746212.
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: 1a1975551943 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
68a8f87c9c
commit
94a600226b
@@ -330,17 +330,16 @@ static void fcoe_ctlr_announce(struct fcoe_ctlr *fip)
|
|||||||
{
|
{
|
||||||
struct fcoe_fcf *sel;
|
struct fcoe_fcf *sel;
|
||||||
struct fcoe_fcf *fcf;
|
struct fcoe_fcf *fcf;
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
mutex_lock(&fip->ctlr_mutex);
|
mutex_lock(&fip->ctlr_mutex);
|
||||||
spin_lock_irqsave(&fip->ctlr_lock, flags);
|
spin_lock_bh(&fip->ctlr_lock);
|
||||||
|
|
||||||
kfree_skb(fip->flogi_req);
|
kfree_skb(fip->flogi_req);
|
||||||
fip->flogi_req = NULL;
|
fip->flogi_req = NULL;
|
||||||
list_for_each_entry(fcf, &fip->fcfs, list)
|
list_for_each_entry(fcf, &fip->fcfs, list)
|
||||||
fcf->flogi_sent = 0;
|
fcf->flogi_sent = 0;
|
||||||
|
|
||||||
spin_unlock_irqrestore(&fip->ctlr_lock, flags);
|
spin_unlock_bh(&fip->ctlr_lock);
|
||||||
sel = fip->sel_fcf;
|
sel = fip->sel_fcf;
|
||||||
|
|
||||||
if (sel && ether_addr_equal(sel->fcf_mac, fip->dest_addr))
|
if (sel && ether_addr_equal(sel->fcf_mac, fip->dest_addr))
|
||||||
@@ -710,7 +709,6 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport,
|
|||||||
{
|
{
|
||||||
struct fc_frame *fp;
|
struct fc_frame *fp;
|
||||||
struct fc_frame_header *fh;
|
struct fc_frame_header *fh;
|
||||||
unsigned long flags;
|
|
||||||
u16 old_xid;
|
u16 old_xid;
|
||||||
u8 op;
|
u8 op;
|
||||||
u8 mac[ETH_ALEN];
|
u8 mac[ETH_ALEN];
|
||||||
@@ -744,11 +742,11 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport,
|
|||||||
op = FIP_DT_FLOGI;
|
op = FIP_DT_FLOGI;
|
||||||
if (fip->mode == FIP_MODE_VN2VN)
|
if (fip->mode == FIP_MODE_VN2VN)
|
||||||
break;
|
break;
|
||||||
spin_lock_irqsave(&fip->ctlr_lock, flags);
|
spin_lock_bh(&fip->ctlr_lock);
|
||||||
kfree_skb(fip->flogi_req);
|
kfree_skb(fip->flogi_req);
|
||||||
fip->flogi_req = skb;
|
fip->flogi_req = skb;
|
||||||
fip->flogi_req_send = 1;
|
fip->flogi_req_send = 1;
|
||||||
spin_unlock_irqrestore(&fip->ctlr_lock, flags);
|
spin_unlock_bh(&fip->ctlr_lock);
|
||||||
schedule_work(&fip->timer_work);
|
schedule_work(&fip->timer_work);
|
||||||
return -EINPROGRESS;
|
return -EINPROGRESS;
|
||||||
case ELS_FDISC:
|
case ELS_FDISC:
|
||||||
@@ -1725,11 +1723,10 @@ static int fcoe_ctlr_flogi_send_locked(struct fcoe_ctlr *fip)
|
|||||||
static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
|
static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
|
||||||
{
|
{
|
||||||
struct fcoe_fcf *fcf;
|
struct fcoe_fcf *fcf;
|
||||||
unsigned long flags;
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
mutex_lock(&fip->ctlr_mutex);
|
mutex_lock(&fip->ctlr_mutex);
|
||||||
spin_lock_irqsave(&fip->ctlr_lock, flags);
|
spin_lock_bh(&fip->ctlr_lock);
|
||||||
LIBFCOE_FIP_DBG(fip, "re-sending FLOGI - reselect\n");
|
LIBFCOE_FIP_DBG(fip, "re-sending FLOGI - reselect\n");
|
||||||
fcf = fcoe_ctlr_select(fip);
|
fcf = fcoe_ctlr_select(fip);
|
||||||
if (!fcf || fcf->flogi_sent) {
|
if (!fcf || fcf->flogi_sent) {
|
||||||
@@ -1740,7 +1737,7 @@ static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
|
|||||||
fcoe_ctlr_solicit(fip, NULL);
|
fcoe_ctlr_solicit(fip, NULL);
|
||||||
error = fcoe_ctlr_flogi_send_locked(fip);
|
error = fcoe_ctlr_flogi_send_locked(fip);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&fip->ctlr_lock, flags);
|
spin_unlock_bh(&fip->ctlr_lock);
|
||||||
mutex_unlock(&fip->ctlr_mutex);
|
mutex_unlock(&fip->ctlr_mutex);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@@ -1757,9 +1754,8 @@ static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
|
|||||||
static void fcoe_ctlr_flogi_send(struct fcoe_ctlr *fip)
|
static void fcoe_ctlr_flogi_send(struct fcoe_ctlr *fip)
|
||||||
{
|
{
|
||||||
struct fcoe_fcf *fcf;
|
struct fcoe_fcf *fcf;
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&fip->ctlr_lock, flags);
|
spin_lock_bh(&fip->ctlr_lock);
|
||||||
fcf = fip->sel_fcf;
|
fcf = fip->sel_fcf;
|
||||||
if (!fcf || !fip->flogi_req_send)
|
if (!fcf || !fip->flogi_req_send)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
@@ -1786,7 +1782,7 @@ static void fcoe_ctlr_flogi_send(struct fcoe_ctlr *fip)
|
|||||||
} else /* XXX */
|
} else /* XXX */
|
||||||
LIBFCOE_FIP_DBG(fip, "No FCF selected - defer send\n");
|
LIBFCOE_FIP_DBG(fip, "No FCF selected - defer send\n");
|
||||||
unlock:
|
unlock:
|
||||||
spin_unlock_irqrestore(&fip->ctlr_lock, flags);
|
spin_unlock_bh(&fip->ctlr_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user