Commit 8e036a94 authored by Dick Kennedy's avatar Dick Kennedy Committed by Martin K. Petersen

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: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f485c18d
...@@ -9396,10 +9396,13 @@ lpfc_sli4_calc_ring(struct lpfc_hba *phba, struct lpfc_iocbq *piocb) ...@@ -9396,10 +9396,13 @@ lpfc_sli4_calc_ring(struct lpfc_hba *phba, struct lpfc_iocbq *piocb)
* for abort iocb hba_wqidx should already * for abort iocb hba_wqidx should already
* be setup based on what work queue we used. * 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 = piocb->hba_wqidx =
lpfc_sli4_scmd_to_wqidx_distr(phba, lpfc_sli4_scmd_to_wqidx_distr(phba,
piocb->context1); piocb->context1);
piocb->hba_wqidx = piocb->hba_wqidx %
phba->cfg_fcp_io_channel;
}
return phba->sli4_hba.fcp_wq[piocb->hba_wqidx]->pring; return phba->sli4_hba.fcp_wq[piocb->hba_wqidx]->pring;
} else { } else {
if (unlikely(!phba->sli4_hba.oas_wq)) if (unlikely(!phba->sli4_hba.oas_wq))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment