summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDick Kennedy <dick.kennedy@broadcom.com>2017-09-29 17:34:35 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2017-10-02 22:46:36 -0400
commit8e036a9497c5d565baafda4c648f2f372999a547 (patch)
tree648132c50d271d623f8ce58c3235b7757372aff0
parentf485c18db27734b37003bf2fafd364234e763633 (diff)
downloadlinux-stable-8e036a9497c5d565baafda4c648f2f372999a547.tar.gz
linux-stable-8e036a9497c5d565baafda4c648f2f372999a547.tar.bz2
linux-stable-8e036a9497c5d565baafda4c648f2f372999a547.zip
scsi: lpfc: Fix FCP hba_wqidx assignment
The driver is encountering oops in lpfc_sli_calc_ring. The driver is setting hba_wqidx for FCP based on the policy in use for NVME. The two may not be the same. Change to set the wqidx based on the FCP policy. Cc: <stable@vger.kernel.org> # 4.12+ Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 2893d4fb9654..8c37885f4851 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -9396,10 +9396,13 @@ lpfc_sli4_calc_ring(struct lpfc_hba *phba, struct lpfc_iocbq *piocb)
* for abort iocb hba_wqidx should already
* be setup based on what work queue we used.
*/
- if (!(piocb->iocb_flag & LPFC_USE_FCPWQIDX))
+ if (!(piocb->iocb_flag & LPFC_USE_FCPWQIDX)) {
piocb->hba_wqidx =
lpfc_sli4_scmd_to_wqidx_distr(phba,
piocb->context1);
+ piocb->hba_wqidx = piocb->hba_wqidx %
+ phba->cfg_fcp_io_channel;
+ }
return phba->sli4_hba.fcp_wq[piocb->hba_wqidx]->pring;
} else {
if (unlikely(!phba->sli4_hba.oas_wq))