OSDN Git Service

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 08:20:03 +0000 (09:20 +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 55cd96e..3f69a5e 100644 (file)
@@ -1332,7 +1332,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;
 
@@ -4264,7 +4264,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 90745fe..99aea52 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 ea2aa5f..4f4d1b3 100644 (file)
@@ -5559,7 +5559,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 68f2238..b36b3da 100644 (file)
@@ -4780,7 +4780,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);