1 From 8b6cc19e49e45f2afe61b2586eb250206eebc1b2 Mon Sep 17 00:00:00 2001
2 From: James Smart <jsmart2021@gmail.com>
3 Date: Tue, 12 Mar 2019 16:30:07 -0700
4 Subject: scsi: lpfc: Fix SLI3 commands being issued on SLI4 devices
6 [ Upstream commit c95a3b4b0fb8d351e2329a96f87c4fc96a149505 ]
8 During debug, it was seen that the driver is issuing commands specific to
9 SLI3 on SLI4 devices. Although the adapter correctly rejected the command,
10 this should not be done.
12 Revise the code to stop sending these commands on a SLI4 adapter.
14 Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
15 Signed-off-by: James Smart <jsmart2021@gmail.com>
16 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
17 Signed-off-by: Sasha Levin <sashal@kernel.org>
19 drivers/scsi/lpfc/lpfc_hbadisc.c | 11 ++++++++++-
20 1 file changed, 10 insertions(+), 1 deletion(-)
22 diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
23 index 4131addfb8729..a67950908db17 100644
24 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c
25 +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
26 @@ -902,7 +902,11 @@ lpfc_linkdown(struct lpfc_hba *phba)
27 lpfc_linkdown_port(vports[i]);
29 lpfc_destroy_vport_work_array(phba, vports);
30 - /* Clean up any firmware default rpi's */
32 + /* Clean up any SLI3 firmware default rpi's */
33 + if (phba->sli_rev > LPFC_SLI_REV3)
34 + goto skip_unreg_did;
36 mb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
38 lpfc_unreg_did(phba, 0xffff, LPFC_UNREG_ALL_DFLT_RPIS, mb);
39 @@ -914,6 +918,7 @@ lpfc_linkdown(struct lpfc_hba *phba)
44 /* Setup myDID for link up if we are in pt2pt mode */
45 if (phba->pport->fc_flag & FC_PT2PT) {
46 phba->pport->fc_myDID = 0;
47 @@ -4647,6 +4652,10 @@ lpfc_unreg_default_rpis(struct lpfc_vport *vport)
51 + /* Unreg DID is an SLI3 operation. */
52 + if (phba->sli_rev > LPFC_SLI_REV3)
55 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
57 lpfc_unreg_did(phba, vport->vpi, LPFC_UNREG_ALL_DFLT_RPIS,