Skip to contentSkip to conversation

lpfc: Fix regressions in 14.2.0.0 refactoring

PATCH Applied James Smart 2 participants 5 messages Mar 23, 2022 – Apr 7, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover lpfc: Fix regressions in 14.2.0.0 refactoring

Two regressions were found in further testing of the refactoring work done for the 14.2.0.0 driver rev.

These 2 patches correct the regressions

James Smart (2):
lpfc: Fix broken sli4 abort path
lpfc: Fix locking for lpfc_sli_iocbq_lookup

 drivers/scsi/lpfc/lpfc_scsi.c | 12 +++++++-----
 drivers/scsi/lpfc/lpfc_sli.c  | 10 ++++++++--
 2 files changed, 15 insertions(+), 7 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/2 lpfc: Fix broken sli4 abort path

There was a merge error in ther 14.2.0.0 patches that resulted in the sli4 path using the sli3 issue_abort_iotag routine. This resulted in txcmplq corruption.

Fix to use the sli4 routine when sli4.

Fixes 31a59f75702f ("scsi: lpfc: SLI path split: Refactor Abort paths")
Cc <[email protected]> # v5.2+
---
 drivers/scsi/lpfc/lpfc_scsi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/scsi/lpfc/lpfc_scsi.c +7 -5
index 3c132604fd91..ba9dbb51b75f 100644
@@ -5929,13 +5929,15 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
 	}
 
 	lpfc_cmd->waitq = &waitq;
-	if (phba->sli_rev == LPFC_SLI_REV4)
+	if (phba->sli_rev == LPFC_SLI_REV4) {
 		spin_unlock(&pring_s4->ring_lock);
-	else
+		ret_val = lpfc_sli4_issue_abort_iotag(phba, iocb,
+						      lpfc_sli_abort_fcp_cmpl);
+	} else {
 		pring = &phba->sli.sli3_ring[LPFC_FCP_RING];
-
-	ret_val = lpfc_sli_issue_abort_iotag(phba, pring, iocb,
-					     lpfc_sli_abort_fcp_cmpl);
+		ret_val = lpfc_sli_issue_abort_iotag(phba, pring, iocb,
+						     lpfc_sli_abort_fcp_cmpl);
+	}
 
 	/* Make sure HBA is alive */
 	lpfc_issue_hb_tmo(phba);
Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/2 lpfc: Fix locking for lpfc_sli_iocbq_lookup

In reply to James Smart

The rules changed for lpfc_sli_iocbq_lookup vs locking. Prior, the routine properly took out the lock. In newly refactored code, the locks must be held when calling the routine.

Fix lpfc_sli_process_sol_iocb() to take the locks before calling the routine.

Fix lpfc_sli_handle_fast_ring_event() to not release the locks to call the routine.

Fixes 1b64aa9eae28 ("scsi: lpfc: SLI path split: Refactor fast and slow paths to native SLI4")
---
 drivers/scsi/lpfc/lpfc_sli.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_sli.c +8 -2
index 20d40957a385..b6a0da28b00f 100644
@@ -3715,7 +3715,15 @@ lpfc_sli_process_sol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
 	unsigned long iflag;
 	u32 ulp_command, ulp_status, ulp_word4, ulp_context, iotag;
 
+	if (phba->sli_rev == LPFC_SLI_REV4)
+		spin_lock_irqsave(&pring->ring_lock, iflag);
+	else
+		spin_lock_irqsave(&phba->hbalock, iflag);
 	cmdiocbp = lpfc_sli_iocbq_lookup(phba, pring, saveq);
+	if (phba->sli_rev == LPFC_SLI_REV4)
+		spin_unlock_irqrestore(&pring->ring_lock, iflag);
+	else
+		spin_unlock_irqrestore(&phba->hbalock, iflag);
 
 	ulp_command = get_job_cmnd(phba, saveq);
 	ulp_status = get_job_ulpstatus(phba, saveq);
@@ -4052,10 +4060,8 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
 				break;
 			}
 
-			spin_unlock_irqrestore(&phba->hbalock, iflag);
 			cmdiocbq = lpfc_sli_iocbq_lookup(phba, pring,
 							 &rspiocbq);
-			spin_lock_irqsave(&phba->hbalock, iflag);
 			if (unlikely(!cmdiocbq))
 				break;
 			if (cmdiocbq->cmd_flag & LPFC_DRIVER_ABORTED)
Signature · 1 line
2.26.2
#3 lore raw
In reply to James Smart

James,

Quoted 2 lines

Two regressions were found in further testing of the refactoring work done for the 14.2.0.0 driver rev.

Applied to 5.18/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#4 lore raw
In reply to James Smart
Quoted 10 lines · James Smart

Two regressions were found in further testing of the refactoring work done for the 14.2.0.0 driver rev.

These 2 patches correct the regressions

James Smart (2):
lpfc: Fix broken sli4 abort path
lpfc: Fix locking for lpfc_sli_iocbq_lookup

[...]

Applied to 5.18/scsi-fixes, thanks!

[1/2] lpfc: Fix broken sli4 abort path

      https://git.kernel.org/mkp/scsi/c/7294a9bcaa7e
[2/2] lpfc: Fix locking for lpfc_sli_iocbq_lookup
      https://git.kernel.org/mkp/scsi/c/c26bd6602e1d
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering