]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
scsi: qla2xxx: Add devids and conditionals for 28xx
authorJoe Carnuccio <joe.carnuccio@cavium.com>
Mon, 10 Jan 2022 05:02:16 +0000 (21:02 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:40:37 +0000 (14:40 +0200)
commit 0d6a536cb1fcabb6c3e9c94871c8d0b29bb5813b upstream.

This is an update to the original 28xx adapter enablement. Add a bunch of
conditionals that are applicable for 28xx.

Link: https://lore.kernel.org/r/20220110050218.3958-16-njavali@marvell.com
Fixes: ecc89f25e225 ("scsi: qla2xxx: Add Device ID for ISP28XX")
Cc: stable@vger.kernel.org
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_sup.c
drivers/scsi/qla2xxx/qla_target.c

index e40a37236aa10a5d0c2728d957122f3b858d56da..d0407f44de78da687d67b87922cf77eaab2070e3 100644 (file)
@@ -555,7 +555,7 @@ qla2x00_sysfs_read_vpd(struct file *filp, struct kobject *kobj,
        if (!capable(CAP_SYS_ADMIN))
                return -EINVAL;
 
-       if (IS_NOCACHE_VPD_TYPE(ha))
+       if (!IS_NOCACHE_VPD_TYPE(ha))
                goto skip;
 
        faddr = ha->flt_region_vpd << 2;
@@ -739,7 +739,7 @@ qla2x00_sysfs_write_reset(struct file *filp, struct kobject *kobj,
                ql_log(ql_log_info, vha, 0x706f,
                    "Issuing MPI reset.\n");
 
-               if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
+               if (IS_QLA83XX(ha)) {
                        uint32_t idc_control;
 
                        qla83xx_idc_lock(vha, 0);
@@ -1050,9 +1050,6 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *vha, bool stop_beacon)
                        continue;
                if (iter->type == 3 && !(IS_CNA_CAPABLE(ha)))
                        continue;
-               if (iter->type == 0x27 &&
-                   (!IS_QLA27XX(ha) || !IS_QLA28XX(ha)))
-                       continue;
 
                sysfs_remove_bin_file(&host->shost_gendev.kobj,
                    iter->attr);
index 8e5dc036956c92eed344c4ad04deecb29362f787..7ca612c9019f5ec9f13e7ef54f8454aa5d508f9f 100644 (file)
@@ -3322,7 +3322,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
                mem_size = (ha->fw_memory_size - 0x11000 + 1) *
                    sizeof(uint16_t);
        } else if (IS_FWI2_CAPABLE(ha)) {
-               if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha))
+               if (IS_QLA83XX(ha))
                        fixed_size = offsetof(struct qla83xx_fw_dump, ext_mem);
                else if (IS_QLA81XX(ha))
                        fixed_size = offsetof(struct qla81xx_fw_dump, ext_mem);
@@ -3334,8 +3334,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
                mem_size = (ha->fw_memory_size - 0x100000 + 1) *
                    sizeof(uint32_t);
                if (ha->mqenable) {
-                       if (!IS_QLA83XX(ha) && !IS_QLA27XX(ha) &&
-                           !IS_QLA28XX(ha))
+                       if (!IS_QLA83XX(ha))
                                mq_size = sizeof(struct qla2xxx_mq_chain);
                        /*
                         * Allocate maximum buffer size for all queues - Q0.
@@ -3896,8 +3895,7 @@ enable_82xx_npiv:
                            ha->fw_major_version, ha->fw_minor_version,
                            ha->fw_subminor_version);
 
-                       if (IS_QLA83XX(ha) || IS_QLA27XX(ha) ||
-                           IS_QLA28XX(ha)) {
+                       if (IS_QLA83XX(ha)) {
                                ha->flags.fac_supported = 0;
                                rval = QLA_SUCCESS;
                        }
index 734745f450211a921beda952e2371011a6f663d5..bbb57edc1f66290b72495b3dcabf7652385aef2f 100644 (file)
@@ -9,6 +9,12 @@
 #include <linux/delay.h>
 #include <linux/gfp.h>
 
+#ifdef CONFIG_PPC
+#define IS_PPCARCH      true
+#else
+#define IS_PPCARCH      false
+#endif
+
 static struct mb_cmd_name {
        uint16_t cmd;
        const char *str;
@@ -698,6 +704,9 @@ again:
                                vha->min_supported_speed =
                                    nv->min_supported_speed;
                        }
+
+                       if (IS_PPCARCH)
+                               mcp->mb[11] |= BIT_4;
                }
 
                if (ha->flags.exlogins_enabled)
@@ -2984,8 +2993,7 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *vha)
                ha->orig_fw_iocb_count = mcp->mb[10];
                if (ha->flags.npiv_supported)
                        ha->max_npiv_vports = mcp->mb[11];
-               if (IS_QLA81XX(ha) || IS_QLA83XX(ha) || IS_QLA27XX(ha) ||
-                   IS_QLA28XX(ha))
+               if (IS_QLA81XX(ha) || IS_QLA83XX(ha))
                        ha->fw_max_fcf_count = mcp->mb[12];
        }
 
@@ -5546,7 +5554,7 @@ qla2x00_get_data_rate(scsi_qla_host_t *vha)
        mcp->out_mb = MBX_1|MBX_0;
        mcp->in_mb = MBX_2|MBX_1|MBX_0;
        if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha))
-               mcp->in_mb |= MBX_3;
+               mcp->in_mb |= MBX_4|MBX_3;
        mcp->tov = MBX_TOV_SECONDS;
        mcp->flags = 0;
        rval = qla2x00_mailbox_command(vha, mcp);
index 4a94054e5585defc4255476d3330bf12068fecff..419156121cb59a9ededeef864994c7c9a3b6d05a 100644 (file)
@@ -3673,8 +3673,7 @@ qla2x00_unmap_iobases(struct qla_hw_data *ha)
                if (ha->mqiobase)
                        iounmap(ha->mqiobase);
 
-               if ((IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) &&
-                   ha->msixbase)
+               if (ha->msixbase)
                        iounmap(ha->msixbase);
        }
 }
index 0f92e9a044dcdb4e27c4226b6f96792bde915824..0fa9c529fca11a51d7191a089335c212fec035d3 100644 (file)
@@ -844,7 +844,7 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
                                ha->flt_region_nvram = start;
                        break;
                case FLT_REG_IMG_PRI_27XX:
-                       if (IS_QLA27XX(ha) && !IS_QLA28XX(ha))
+                       if (IS_QLA27XX(ha) || IS_QLA28XX(ha))
                                ha->flt_region_img_status_pri = start;
                        break;
                case FLT_REG_IMG_SEC_27XX:
@@ -1356,7 +1356,7 @@ next:
                    flash_data_addr(ha, faddr), le32_to_cpu(*dwptr));
                if (ret) {
                        ql_dbg(ql_dbg_user, vha, 0x7006,
-                           "Failed slopw write %x (%x)\n", faddr, *dwptr);
+                           "Failed slow write %x (%x)\n", faddr, *dwptr);
                        break;
                }
        }
index 0b19e3fb74ca6b6f184716227be48498efaf521a..cf9ae0ab489a0ef2566c0c1d58abcbe897a2c75c 100644 (file)
@@ -7077,8 +7077,7 @@ qlt_probe_one_stage1(struct scsi_qla_host *base_vha, struct qla_hw_data *ha)
        if (!QLA_TGT_MODE_ENABLED())
                return;
 
-       if  ((ql2xenablemsix == 0) || IS_QLA83XX(ha) || IS_QLA27XX(ha) ||
-           IS_QLA28XX(ha)) {
+       if  (ha->mqenable || IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
                ISP_ATIO_Q_IN(base_vha) = &ha->mqiobase->isp25mq.atio_q_in;
                ISP_ATIO_Q_OUT(base_vha) = &ha->mqiobase->isp25mq.atio_q_out;
        } else {