scsi: lpfc: Enable Management features for IF_TYPE=6
authorJames Smart <jsmart2021@gmail.com>
Tue, 11 Dec 2018 03:37:01 +0000 (19:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:16 +0000 (15:37 +0100)
[ Upstream commit 719162bd5bb968203397b9b1d0dd30a9797bbd09 ]

Addition of support for if_type=6 missed several checks for interface type,
resulting in the failure of several key management features such as
firmware dump and loopback testing.

Correct the checks on the if_type so that both SLI4 IF_TYPE's 2 and 6 are
supported.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_bsg.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hbadisc.c

index 3da242201cb4584b51370a0f43bd7801c8eed0cc..82ce5d193018906b1e3413a355bbcfa1dc2659fe 100644 (file)
@@ -1178,7 +1178,7 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
                return -EACCES;
 
        if ((phba->sli_rev < LPFC_SLI_REV4) ||
-           (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
+           (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
             LPFC_SLI_INTF_IF_TYPE_2))
                return -EPERM;
 
@@ -4056,7 +4056,7 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
        uint32_t prev_val, if_type;
 
        if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf);
-       if (if_type == LPFC_SLI_INTF_IF_TYPE_2 &&
+       if (if_type >= LPFC_SLI_INTF_IF_TYPE_2 &&
            phba->hba_flag & HBA_FORCED_LINK_SPEED)
                return -EPERM;
 
index d89816222b23058ab4b74ccbb4b8602a49a04a84..6dde21dc82a3cee41ed1b5d89a0f15357c83574d 100644 (file)
@@ -2221,7 +2221,7 @@ lpfc_bsg_diag_loopback_mode(struct bsg_job *job)
 
        if (phba->sli_rev < LPFC_SLI_REV4)
                rc = lpfc_sli3_bsg_diag_loopback_mode(phba, job);
-       else if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) ==
+       else if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) >=
                 LPFC_SLI_INTF_IF_TYPE_2)
                rc = lpfc_sli4_bsg_diag_loopback_mode(phba, job);
        else
@@ -2261,7 +2261,7 @@ lpfc_sli4_bsg_diag_mode_end(struct bsg_job *job)
 
        if (phba->sli_rev < LPFC_SLI_REV4)
                return -ENODEV;
-       if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
+       if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
            LPFC_SLI_INTF_IF_TYPE_2)
                return -ENODEV;
 
@@ -2353,7 +2353,7 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job)
                rc = -ENODEV;
                goto job_error;
        }
-       if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
+       if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
            LPFC_SLI_INTF_IF_TYPE_2) {
                rc = -ENODEV;
                goto job_error;
index a31f87eb1e62187af973f2973b092f6964f776ac..c851fd14ff3e9929cae9f03fd7e446880c3a0a82 100644 (file)
@@ -5550,7 +5550,7 @@ lpfc_els_rcv_rdp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
        struct ls_rjt stat;
 
        if (phba->sli_rev < LPFC_SLI_REV4 ||
-           bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
+           bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
                                                LPFC_SLI_INTF_IF_TYPE_2) {
                rjt_err = LSRJT_UNABLE_TPC;
                rjt_expl = LSEXP_REQ_UNSUPPORTED;
index d850077c5e226fbacc5d4ff21b16c9f3e0f02aca..3f88f3d796227c3a6820099f906e2b3b40a0add3 100644 (file)
@@ -4769,7 +4769,7 @@ lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
                                if (phba->sli_rev == LPFC_SLI_REV4 &&
                                    (!(vport->load_flag & FC_UNLOADING)) &&
                                    (bf_get(lpfc_sli_intf_if_type,
-                                    &phba->sli4_hba.sli_intf) ==
+                                    &phba->sli4_hba.sli_intf) >=
                                      LPFC_SLI_INTF_IF_TYPE_2) &&
                                    (kref_read(&ndlp->kref) > 0)) {
                                        mbox->context1 = lpfc_nlp_get(ndlp);