]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 18:21:53 +0000 (20:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 18:21:53 +0000 (20:21 +0200)
added patches:
scsi-qla2xxx-fix-erroneous-link-up-failure.patch
scsi-qla2xxx-fix-inconsistent-tmf-timeout.patch
scsi-qla2xxx-flush-mailbox-commands-on-chip-reset.patch
scsi-qla2xxx-remove-unsupported-ql2xenabledif-option.patch
scsi-qla2xxx-turn-off-noisy-message-log.patch

queue-5.4/scsi-qla2xxx-fix-erroneous-link-up-failure.patch [new file with mode: 0644]
queue-5.4/scsi-qla2xxx-fix-inconsistent-tmf-timeout.patch [new file with mode: 0644]
queue-5.4/scsi-qla2xxx-flush-mailbox-commands-on-chip-reset.patch [new file with mode: 0644]
queue-5.4/scsi-qla2xxx-remove-unsupported-ql2xenabledif-option.patch [new file with mode: 0644]
queue-5.4/scsi-qla2xxx-turn-off-noisy-message-log.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/scsi-qla2xxx-fix-erroneous-link-up-failure.patch b/queue-5.4/scsi-qla2xxx-fix-erroneous-link-up-failure.patch
new file mode 100644 (file)
index 0000000..626b37e
--- /dev/null
@@ -0,0 +1,68 @@
+From 5b51f35d127e7bef55fa869d2465e2bca4636454 Mon Sep 17 00:00:00 2001
+From: Quinn Tran <qutran@marvell.com>
+Date: Fri, 14 Jul 2023 12:30:59 +0530
+Subject: scsi: qla2xxx: Fix erroneous link up failure
+
+From: Quinn Tran <qutran@marvell.com>
+
+commit 5b51f35d127e7bef55fa869d2465e2bca4636454 upstream.
+
+Link up failure occurred where driver failed to see certain events from FW
+indicating link up (AEN 8011) and fabric login completion (AEN 8014).
+Without these 2 events, driver would not proceed forward to scan the
+fabric. The cause of this is due to delay in the receive of interrupt for
+Mailbox 60 that causes qla to set the fw_started flag late.  The late
+setting of this flag causes other interrupts to be dropped.  These dropped
+interrupts happen to be the link up (AEN 8011) and fabric login completion
+(AEN 8014).
+
+Set fw_started flag early to prevent interrupts being dropped.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Quinn Tran <qutran@marvell.com>
+Signed-off-by: Nilesh Javali <njavali@marvell.com>
+Link: https://lore.kernel.org/r/20230714070104.40052-6-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_init.c |    3 ++-
+ drivers/scsi/qla2xxx/qla_isr.c  |    6 +++++-
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+--- a/drivers/scsi/qla2xxx/qla_init.c
++++ b/drivers/scsi/qla2xxx/qla_init.c
+@@ -4176,15 +4176,16 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
+                   (ha->flags.fawwpn_enabled) ? "enabled" : "disabled");
+       }
++      QLA_FW_STARTED(ha);
+       rval = qla2x00_init_firmware(vha, ha->init_cb_size);
+ next_check:
+       if (rval) {
++              QLA_FW_STOPPED(ha);
+               ql_log(ql_log_fatal, vha, 0x00d2,
+                   "Init Firmware **** FAILED ****.\n");
+       } else {
+               ql_dbg(ql_dbg_init, vha, 0x00d3,
+                   "Init Firmware -- success.\n");
+-              QLA_FW_STARTED(ha);
+               vha->u_ql2xexchoffld = vha->u_ql2xiniexchg = 0;
+       }
+--- a/drivers/scsi/qla2xxx/qla_isr.c
++++ b/drivers/scsi/qla2xxx/qla_isr.c
+@@ -639,8 +639,12 @@ qla2x00_async_event(scsi_qla_host_t *vha
+       unsigned long   flags;
+       fc_port_t       *fcport = NULL;
+-      if (!vha->hw->flags.fw_started)
++      if (!vha->hw->flags.fw_started) {
++              ql_log(ql_log_warn, vha, 0x50ff,
++                  "Dropping AEN - %04x %04x %04x %04x.\n",
++                  mb[0], mb[1], mb[2], mb[3]);
+               return;
++      }
+       /* Setup to process RIO completion. */
+       handle_cnt = 0;
diff --git a/queue-5.4/scsi-qla2xxx-fix-inconsistent-tmf-timeout.patch b/queue-5.4/scsi-qla2xxx-fix-inconsistent-tmf-timeout.patch
new file mode 100644 (file)
index 0000000..894f3ba
--- /dev/null
@@ -0,0 +1,36 @@
+From 009e7fe4a1ed52276b332842a6b6e23b07200f2d Mon Sep 17 00:00:00 2001
+From: Quinn Tran <qutran@marvell.com>
+Date: Fri, 14 Jul 2023 12:31:03 +0530
+Subject: scsi: qla2xxx: fix inconsistent TMF timeout
+
+From: Quinn Tran <qutran@marvell.com>
+
+commit 009e7fe4a1ed52276b332842a6b6e23b07200f2d upstream.
+
+Different behavior were experienced of session being torn down vs not when
+TMF is timed out. When FW detects the time out, the session is torn down.
+When driver detects the time out, the session is not torn down.
+
+Allow TMF error to return to upper layer without session tear down.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Quinn Tran <qutran@marvell.com>
+Signed-off-by: Nilesh Javali <njavali@marvell.com>
+Link: https://lore.kernel.org/r/20230714070104.40052-10-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_isr.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/scsi/qla2xxx/qla_isr.c
++++ b/drivers/scsi/qla2xxx/qla_isr.c
+@@ -2711,7 +2711,6 @@ check_scsi_status:
+       case CS_PORT_BUSY:
+       case CS_INCOMPLETE:
+       case CS_PORT_UNAVAILABLE:
+-      case CS_TIMEOUT:
+       case CS_RESET:
+               /*
diff --git a/queue-5.4/scsi-qla2xxx-flush-mailbox-commands-on-chip-reset.patch b/queue-5.4/scsi-qla2xxx-flush-mailbox-commands-on-chip-reset.patch
new file mode 100644 (file)
index 0000000..0945838
--- /dev/null
@@ -0,0 +1,104 @@
+From 6d0b65569c0a10b27c49bacd8d25bcd406003533 Mon Sep 17 00:00:00 2001
+From: Quinn Tran <qutran@marvell.com>
+Date: Mon, 21 Aug 2023 18:30:38 +0530
+Subject: scsi: qla2xxx: Flush mailbox commands on chip reset
+
+From: Quinn Tran <qutran@marvell.com>
+
+commit 6d0b65569c0a10b27c49bacd8d25bcd406003533 upstream.
+
+Fix race condition between Interrupt thread and Chip reset thread in trying
+to flush the same mailbox. With the race condition, the "ha->mbx_intr_comp"
+will get an extra complete() call. The extra complete call create erroneous
+mailbox timeout condition when the next mailbox is sent where the mailbox
+call does not wait for interrupt to arrive. Instead, it advances without
+waiting.
+
+Add lock protection around the check for mailbox completion.
+
+Cc: stable@vger.kernel.org
+Fixes: b2000805a975 ("scsi: qla2xxx: Flush mailbox commands on chip reset")
+Signed-off-by: Quinn Tran <quinn.tran@marvell.com>
+Signed-off-by: Nilesh Javali <njavali@marvell.com>
+Link: https://lore.kernel.org/r/20230821130045.34850-3-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_def.h  |    1 -
+ drivers/scsi/qla2xxx/qla_init.c |    7 ++++---
+ drivers/scsi/qla2xxx/qla_mbx.c  |    4 ----
+ drivers/scsi/qla2xxx/qla_os.c   |    1 -
+ 4 files changed, 4 insertions(+), 9 deletions(-)
+
+--- a/drivers/scsi/qla2xxx/qla_def.h
++++ b/drivers/scsi/qla2xxx/qla_def.h
+@@ -3952,7 +3952,6 @@ struct qla_hw_data {
+       uint8_t         aen_mbx_count;
+       atomic_t        num_pend_mbx_stage1;
+       atomic_t        num_pend_mbx_stage2;
+-      atomic_t        num_pend_mbx_stage3;
+       uint16_t        frame_payload_size;
+       uint32_t        login_retry_count;
+--- a/drivers/scsi/qla2xxx/qla_init.c
++++ b/drivers/scsi/qla2xxx/qla_init.c
+@@ -6740,14 +6740,15 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_
+       }
+       /* purge MBox commands */
+-      if (atomic_read(&ha->num_pend_mbx_stage3)) {
++      spin_lock_irqsave(&ha->hardware_lock, flags);
++      if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags)) {
+               clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
+               complete(&ha->mbx_intr_comp);
+       }
++      spin_unlock_irqrestore(&ha->hardware_lock, flags);
+       i = 0;
+-      while (atomic_read(&ha->num_pend_mbx_stage3) ||
+-          atomic_read(&ha->num_pend_mbx_stage2) ||
++      while (atomic_read(&ha->num_pend_mbx_stage2) ||
+           atomic_read(&ha->num_pend_mbx_stage1)) {
+               msleep(20);
+               i++;
+--- a/drivers/scsi/qla2xxx/qla_mbx.c
++++ b/drivers/scsi/qla2xxx/qla_mbx.c
+@@ -268,7 +268,6 @@ qla2x00_mailbox_command(scsi_qla_host_t
+               spin_unlock_irqrestore(&ha->hardware_lock, flags);
+               wait_time = jiffies;
+-              atomic_inc(&ha->num_pend_mbx_stage3);
+               if (!wait_for_completion_timeout(&ha->mbx_intr_comp,
+                   mcp->tov * HZ)) {
+                       ql_dbg(ql_dbg_mbx, vha, 0x117a,
+@@ -283,7 +282,6 @@ qla2x00_mailbox_command(scsi_qla_host_t
+                               spin_unlock_irqrestore(&ha->hardware_lock,
+                                   flags);
+                               atomic_dec(&ha->num_pend_mbx_stage2);
+-                              atomic_dec(&ha->num_pend_mbx_stage3);
+                               rval = QLA_ABORTED;
+                               goto premature_exit;
+                       }
+@@ -293,11 +291,9 @@ qla2x00_mailbox_command(scsi_qla_host_t
+                       ha->flags.mbox_busy = 0;
+                       spin_unlock_irqrestore(&ha->hardware_lock, flags);
+                       atomic_dec(&ha->num_pend_mbx_stage2);
+-                      atomic_dec(&ha->num_pend_mbx_stage3);
+                       rval = QLA_ABORTED;
+                       goto premature_exit;
+               }
+-              atomic_dec(&ha->num_pend_mbx_stage3);
+               if (time_after(jiffies, wait_time + 5 * HZ))
+                       ql_log(ql_log_warn, vha, 0x1015, "cmd=0x%x, waited %d msecs\n",
+--- a/drivers/scsi/qla2xxx/qla_os.c
++++ b/drivers/scsi/qla2xxx/qla_os.c
+@@ -2837,7 +2837,6 @@ qla2x00_probe_one(struct pci_dev *pdev,
+       ha->max_exchg = FW_MAX_EXCHANGES_CNT;
+       atomic_set(&ha->num_pend_mbx_stage1, 0);
+       atomic_set(&ha->num_pend_mbx_stage2, 0);
+-      atomic_set(&ha->num_pend_mbx_stage3, 0);
+       atomic_set(&ha->zio_threshold, DEFAULT_ZIO_THRESHOLD);
+       ha->last_zio_threshold = DEFAULT_ZIO_THRESHOLD;
diff --git a/queue-5.4/scsi-qla2xxx-remove-unsupported-ql2xenabledif-option.patch b/queue-5.4/scsi-qla2xxx-remove-unsupported-ql2xenabledif-option.patch
new file mode 100644 (file)
index 0000000..839fb80
--- /dev/null
@@ -0,0 +1,75 @@
+From e9105c4b7a9208a21a9bda133707624f12ddabc2 Mon Sep 17 00:00:00 2001
+From: Manish Rangankar <mrangankar@marvell.com>
+Date: Mon, 21 Aug 2023 18:30:42 +0530
+Subject: scsi: qla2xxx: Remove unsupported ql2xenabledif option
+
+From: Manish Rangankar <mrangankar@marvell.com>
+
+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 |    2 --
+ drivers/scsi/qla2xxx/qla_dbg.c  |    2 +-
+ drivers/scsi/qla2xxx/qla_os.c   |    9 +++++++--
+ 3 files changed, 8 insertions(+), 5 deletions(-)
+
+--- a/drivers/scsi/qla2xxx/qla_attr.c
++++ b/drivers/scsi/qla2xxx/qla_attr.c
+@@ -2864,8 +2864,6 @@ qla24xx_vport_create(struct fc_vport *fc
+                       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
+--- a/drivers/scsi/qla2xxx/qla_dbg.c
++++ b/drivers/scsi/qla2xxx/qla_dbg.c
+@@ -22,7 +22,7 @@
+  * | Queue Command and IO tracing |       0x3074       | 0x300b         |
+  * |                              |                    | 0x3027-0x3028  |
+  * |                              |                    | 0x303d-0x3041  |
+- * |                              |                    | 0x302d,0x3033  |
++ * |                              |                    | 0x302e,0x3033  |
+  * |                              |                    | 0x3036,0x3038  |
+  * |                              |                    | 0x303a               |
+  * | DPC Thread                   |       0x4023       | 0x4002,0x4013  |
+--- a/drivers/scsi/qla2xxx/qla_os.c
++++ b/drivers/scsi/qla2xxx/qla_os.c
+@@ -3112,6 +3112,13 @@ qla2x00_probe_one(struct pci_dev *pdev,
+       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
+@@ -3343,8 +3350,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
diff --git a/queue-5.4/scsi-qla2xxx-turn-off-noisy-message-log.patch b/queue-5.4/scsi-qla2xxx-turn-off-noisy-message-log.patch
new file mode 100644 (file)
index 0000000..8091def
--- /dev/null
@@ -0,0 +1,33 @@
+From 8ebaa45163a3fedc885c1dc7d43ea987a2f00a06 Mon Sep 17 00:00:00 2001
+From: Quinn Tran <qutran@marvell.com>
+Date: Fri, 14 Jul 2023 12:31:01 +0530
+Subject: scsi: qla2xxx: Turn off noisy message log
+
+From: Quinn Tran <qutran@marvell.com>
+
+commit 8ebaa45163a3fedc885c1dc7d43ea987a2f00a06 upstream.
+
+Some consider noisy log as test failure.  Turn off noisy message log.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Quinn Tran <qutran@marvell.com>
+Signed-off-by: Nilesh Javali <njavali@marvell.com>
+Link: https://lore.kernel.org/r/20230714070104.40052-8-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_nvme.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/scsi/qla2xxx/qla_nvme.c
++++ b/drivers/scsi/qla2xxx/qla_nvme.c
+@@ -577,7 +577,7 @@ static int qla_nvme_post_cmd(struct nvme
+       rval = qla2x00_start_nvme_mq(sp);
+       if (rval != QLA_SUCCESS) {
+-              ql_log(ql_log_warn, vha, 0x212d,
++              ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x212d,
+                   "qla2x00_start_nvme_mq failed = %d\n", rval);
+               sp->priv = NULL;
+               priv->sp = NULL;
index d7c9766f9838628b735195d5be9d0591bf2798a8..5db2a4c5383de42af4dad6c1fcded1002a94f214 100644 (file)
@@ -238,3 +238,8 @@ usb-typec-tcpci-clear-the-fault-status-bit.patch
 udf-initialize-newblock-to-0.patch
 drm-fix-double-free-for-gbo-in-drm_gem_vram_init-and-drm_gem_vram_create.patch
 net-ipv6-skb-symmetric-hash-should-incorporate-transport-ports.patch
+scsi-qla2xxx-fix-inconsistent-tmf-timeout.patch
+scsi-qla2xxx-fix-erroneous-link-up-failure.patch
+scsi-qla2xxx-turn-off-noisy-message-log.patch
+scsi-qla2xxx-remove-unsupported-ql2xenabledif-option.patch
+scsi-qla2xxx-flush-mailbox-commands-on-chip-reset.patch