]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
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)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 13 Dec 2018 01:33:08 +0000 (20:33 -0500)
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>
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 83924d66fd39d2a533e1ecf2e28fb8138ceb7aee..513ac1be861fb2119bece4e9a547fcfec68f2363 100644 (file)
@@ -1358,7 +1358,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;
 
@@ -4361,7 +4361,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 cb18dac68e281019b6e0fc543951b7436dd3cef8..8698af86485d5380c9ba26d6e548b62f6d23e8a3 100644 (file)
@@ -2222,7 +2222,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
@@ -2262,7 +2262,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;
 
@@ -2354,7 +2354,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 27e0f10cefed33a205918ada16b9a1413e087a1c..b3a4789468c3807572ce23e985946d930cdb38fd 100644 (file)
@@ -5733,7 +5733,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 8857f559e6c32673c1ca28f7418ec2d46627383d..91189e9c8530f95821c72138c3ff41ab401559cf 100644 (file)
@@ -4850,7 +4850,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->ctx_ndlp = lpfc_nlp_get(ndlp);