Linux-SCSI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] lpfc: Fix reset recovery paths that are not recovering
@ 2019-09-03 21:54 James Smart
  2019-09-07 20:29 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: James Smart @ 2019-09-03 21:54 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Dick Kennedy

A recent patch unconditionally marks the hba as in error as part
of resetting the adapter. The driver flow that called the adapter
reset was a recovery path, which expects the adapter to not be in
an error state in order to finish the recovery.  Given the new error
state being set, the recovery fails and the adapter is left in limbo.

Revise the adapter reset routine so that it will only mark the
adapter in error if it was unable to reset the adapter.

Fixes: 8c24a4f643ed ("scsi: lpfc: Fix crash due to port reset racing vs adapter error handling")
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>

---
Indicated commit that is fixed is only in 5.4/scsi-queue
---
 drivers/scsi/lpfc/lpfc_sli.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index bb5705267c39..75bb75800642 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -4619,8 +4619,10 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba)
 	hba_aer_enabled = phba->hba_flag & HBA_AER_ENABLED;
 
 	rc = lpfc_sli4_brdreset(phba);
-	if (rc)
-		goto error;
+	if (rc) {
+		phba->link_state = LPFC_HBA_ERROR;
+		goto hba_down_queue;
+	}
 
 	spin_lock_irq(&phba->hbalock);
 	phba->pport->stopped = 0;
@@ -4635,8 +4637,7 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba)
 	if (hba_aer_enabled)
 		pci_disable_pcie_error_reporting(phba->pcidev);
 
-error:
-	phba->link_state = LPFC_HBA_ERROR;
+hba_down_queue:
 	lpfc_hba_down_post(phba);
 	lpfc_sli4_queue_destroy(phba);
 
-- 
2.13.7


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] lpfc: Fix reset recovery paths that are not recovering
  2019-09-03 21:54 [PATCH] lpfc: Fix reset recovery paths that are not recovering James Smart
@ 2019-09-07 20:29 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2019-09-07 20:29 UTC (permalink / raw)
  To: James Smart; +Cc: linux-scsi, Dick Kennedy


James,

> A recent patch unconditionally marks the hba as in error as part of
> resetting the adapter. The driver flow that called the adapter reset
> was a recovery path, which expects the adapter to not be in an error
> state in order to finish the recovery.  Given the new error state
> being set, the recovery fails and the adapter is left in limbo.
>
> Revise the adapter reset routine so that it will only mark the adapter
> in error if it was unable to reset the adapter.

Applied to 5.4/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03 21:54 [PATCH] lpfc: Fix reset recovery paths that are not recovering James Smart
2019-09-07 20:29 ` Martin K. Petersen

Linux-SCSI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-scsi/0 linux-scsi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-scsi linux-scsi/ https://lore.kernel.org/linux-scsi \
		linux-scsi@vger.kernel.org linux-scsi@archiver.kernel.org
	public-inbox-index linux-scsi


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-scsi


AGPL code for this site: git clone https://public-inbox.org/ public-inbox