scsi: qla2xxx: Remove unsupported ql2xenabledif option
authorManish Rangankar <mrangankar@marvell.com>
Mon, 21 Aug 2023 13:00:42 +0000 (18:30 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:27:55 +0000 (12:27 +0200)
commit e9105c4b7a9208a21a9bda133707624f12ddabc2 upstream.

User accidently passed module parameter ql2xenabledif=1 which is
unsupported. However, driver still initialized which lead to guard tag
errors during device discovery.

Remove unsupported ql2xenabledif=1 option and validate the user input.

Cc: stable@vger.kernel.org
Signed-off-by: Manish Rangankar <mrangankar@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20230821130045.34850-7-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.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_dbg.c
drivers/scsi/qla2xxx/qla_os.c

index 64734d6e8ccb135cb6b8ab33914579f8a77d484c..07fbaa452d8a125756d515ee05190147b7044203 100644 (file)
@@ -3093,8 +3093,6 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable)
                        vha->flags.difdix_supported = 1;
                        ql_dbg(ql_dbg_user, vha, 0x7082,
                            "Registered for DIF/DIX type 1 and 3 protection.\n");
-                       if (ql2xenabledif == 1)
-                               prot = SHOST_DIX_TYPE0_PROTECTION;
                        scsi_host_set_prot(vha->host,
                            prot | SHOST_DIF_TYPE1_PROTECTION
                            | SHOST_DIF_TYPE2_PROTECTION
index d7e8454304ceea98feddf77802104a32ba1e0c1c..ab637324262ff0bc44d537f34c23b2866e5b25f0 100644 (file)
@@ -18,7 +18,7 @@
  * | Queue Command and IO tracing |       0x3074       | 0x300b         |
  * |                              |                    | 0x3027-0x3028  |
  * |                              |                    | 0x303d-0x3041  |
- * |                              |                    | 0x302d,0x3033  |
+ * |                              |                    | 0x302e,0x3033  |
  * |                              |                    | 0x3036,0x3038  |
  * |                              |                    | 0x303a                |
  * | DPC Thread                   |       0x4023       | 0x4002,0x4013  |
index aadf38b44581901f0aaedf31fabb22825f6f7216..e75e5eddfe1c00518e30d08d500d5647b4bda720 100644 (file)
@@ -3281,6 +3281,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        host->max_id = ha->max_fibre_devices;
        host->cmd_per_lun = 3;
        host->unique_id = host->host_no;
+
+       if (ql2xenabledif && ql2xenabledif != 2) {
+               ql_log(ql_log_warn, base_vha, 0x302d,
+                      "Invalid value for ql2xenabledif, resetting it to default (2)\n");
+               ql2xenabledif = 2;
+       }
+
        if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif)
                host->max_cmd_len = 32;
        else
@@ -3518,8 +3525,6 @@ skip_dpc:
                        base_vha->flags.difdix_supported = 1;
                        ql_dbg(ql_dbg_init, base_vha, 0x00f1,
                            "Registering for DIF/DIX type 1 and 3 protection.\n");
-                       if (ql2xenabledif == 1)
-                               prot = SHOST_DIX_TYPE0_PROTECTION;
                        if (ql2xprotmask)
                                scsi_host_set_prot(host, ql2xprotmask);
                        else