]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.181/scsi-lpfc-fix-sli3-commands-being-issued-on-sli4-dev.patch
Linux 4.4.181
[thirdparty/kernel/stable-queue.git] / releases / 4.4.181 / scsi-lpfc-fix-sli3-commands-being-issued-on-sli4-dev.patch
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
5
6 [ Upstream commit c95a3b4b0fb8d351e2329a96f87c4fc96a149505 ]
7
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.
11
12 Revise the code to stop sending these commands on a SLI4 adapter.
13
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>
18 ---
19 drivers/scsi/lpfc/lpfc_hbadisc.c | 11 ++++++++++-
20 1 file changed, 10 insertions(+), 1 deletion(-)
21
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]);
28 }
29 lpfc_destroy_vport_work_array(phba, vports);
30 - /* Clean up any firmware default rpi's */
31 +
32 + /* Clean up any SLI3 firmware default rpi's */
33 + if (phba->sli_rev > LPFC_SLI_REV3)
34 + goto skip_unreg_did;
35 +
36 mb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
37 if (mb) {
38 lpfc_unreg_did(phba, 0xffff, LPFC_UNREG_ALL_DFLT_RPIS, mb);
39 @@ -914,6 +918,7 @@ lpfc_linkdown(struct lpfc_hba *phba)
40 }
41 }
42
43 + skip_unreg_did:
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)
48 LPFC_MBOXQ_t *mbox;
49 int rc;
50
51 + /* Unreg DID is an SLI3 operation. */
52 + if (phba->sli_rev > LPFC_SLI_REV3)
53 + return;
54 +
55 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
56 if (mbox) {
57 lpfc_unreg_did(phba, vport->vpi, LPFC_UNREG_ALL_DFLT_RPIS,
58 --
59 2.20.1
60