Home Home > GIT Browse > SLE12-SP3-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2019-02-18 15:45:38 +0100
committerJohannes Thumshirn <jthumshirn@suse.de>2019-02-18 15:45:38 +0100
commit991021fd328b1f8d2d0e1af9c3d2d3aae7adcec4 (patch)
treea6a282cd6943bebfceea0d4d3c710650d5288a67
parentacedf0543b60906d08b2f98c051ecf4e51a24754 (diff)
scsi: qla2xxx: Fix deadlock between ATIO and HW lock
(bsc#1125794).
-rw-r--r--patches.fixes/scsi-qla2xxx-fix-deadlock-between-atio-and-hw-lock.patch148
-rw-r--r--series.conf1
2 files changed, 149 insertions, 0 deletions
diff --git a/patches.fixes/scsi-qla2xxx-fix-deadlock-between-atio-and-hw-lock.patch b/patches.fixes/scsi-qla2xxx-fix-deadlock-between-atio-and-hw-lock.patch
new file mode 100644
index 0000000000..7a5b5bc99d
--- /dev/null
+++ b/patches.fixes/scsi-qla2xxx-fix-deadlock-between-atio-and-hw-lock.patch
@@ -0,0 +1,148 @@
+From: Quinn Tran <quinn.tran@cavium.com>
+Date: Tue, 4 Sep 2018 14:19:10 -0700
+Subject: scsi: qla2xxx: Fix deadlock between ATIO and HW lock
+Git-commit: 1073daa470d906f1853ed4b828f16e2350a5875c
+Patch-mainline: v4.20-rc1
+References: bsc#1125794
+
+Move ATIO queue processing out of hardware_lock to prevent deadlock.
+
+Fixes: 3bb67df5b5f8 ("qla2xxx: Check for online flag instead of active reset when transmitting responses")
+Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
+Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ drivers/scsi/qla2xxx/qla_init.c | 17 ++++-----------
+ drivers/scsi/qla2xxx/qla_isr.c | 48 +++++++++++++++++++----------------------
+ 2 files changed, 26 insertions(+), 39 deletions(-)
+
+diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
+index f8f55184f542..c3c7ab6fe6e1 100644
+--- a/drivers/scsi/qla2xxx/qla_init.c
++++ b/drivers/scsi/qla2xxx/qla_init.c
+@@ -4859,19 +4859,10 @@ qla2x00_configure_loop(scsi_qla_host_t *vha)
+ */
+ if (qla_tgt_mode_enabled(vha) ||
+ qla_dual_mode_enabled(vha)) {
+- if (IS_QLA27XX(ha) || IS_QLA83XX(ha)) {
+- spin_lock_irqsave(&ha->tgt.atio_lock,
+- flags);
+- qlt_24xx_process_atio_queue(vha, 0);
+- spin_unlock_irqrestore(
+- &ha->tgt.atio_lock, flags);
+- } else {
+- spin_lock_irqsave(&ha->hardware_lock,
+- flags);
+- qlt_24xx_process_atio_queue(vha, 1);
+- spin_unlock_irqrestore(
+- &ha->hardware_lock, flags);
+- }
++ spin_lock_irqsave(&ha->tgt.atio_lock, flags);
++ qlt_24xx_process_atio_queue(vha, 0);
++ spin_unlock_irqrestore(&ha->tgt.atio_lock,
++ flags);
+ }
+ }
+ }
+diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
+index 36cbb29c84f6..bc97e3a1bef7 100644
+--- a/drivers/scsi/qla2xxx/qla_isr.c
++++ b/drivers/scsi/qla2xxx/qla_isr.c
+@@ -3121,6 +3121,7 @@ qla24xx_intr_handler(int irq, void *dev_id)
+ uint16_t mb[8];
+ struct rsp_que *rsp;
+ unsigned long flags;
++ bool process_atio = false;
+
+ rsp = (struct rsp_que *) dev_id;
+ if (!rsp) {
+@@ -3181,22 +3182,13 @@ qla24xx_intr_handler(int irq, void *dev_id)
+ qla24xx_process_response_queue(vha, rsp);
+ break;
+ case INTR_ATIO_QUE_UPDATE_27XX:
+- case INTR_ATIO_QUE_UPDATE:{
+- unsigned long flags2;
+- spin_lock_irqsave(&ha->tgt.atio_lock, flags2);
+- qlt_24xx_process_atio_queue(vha, 1);
+- spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2);
++ case INTR_ATIO_QUE_UPDATE:
++ process_atio = true;
+ break;
+- }
+- case INTR_ATIO_RSP_QUE_UPDATE: {
+- unsigned long flags2;
+- spin_lock_irqsave(&ha->tgt.atio_lock, flags2);
+- qlt_24xx_process_atio_queue(vha, 1);
+- spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2);
+-
++ case INTR_ATIO_RSP_QUE_UPDATE:
++ process_atio = true;
+ qla24xx_process_response_queue(vha, rsp);
+ break;
+- }
+ default:
+ ql_dbg(ql_dbg_async, vha, 0x504f,
+ "Unrecognized interrupt type (%d).\n", stat * 0xff);
+@@ -3210,6 +3202,12 @@ qla24xx_intr_handler(int irq, void *dev_id)
+ qla2x00_handle_mbx_completion(ha, status);
+ spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
++ if (process_atio) {
++ spin_lock_irqsave(&ha->tgt.atio_lock, flags);
++ qlt_24xx_process_atio_queue(vha, 0);
++ spin_unlock_irqrestore(&ha->tgt.atio_lock, flags);
++ }
++
+ return IRQ_HANDLED;
+ }
+
+@@ -3256,6 +3254,7 @@ qla24xx_msix_default(int irq, void *dev_id)
+ uint32_t hccr;
+ uint16_t mb[8];
+ unsigned long flags;
++ bool process_atio = false;
+
+ rsp = (struct rsp_que *) dev_id;
+ if (!rsp) {
+@@ -3312,22 +3311,13 @@ qla24xx_msix_default(int irq, void *dev_id)
+ qla24xx_process_response_queue(vha, rsp);
+ break;
+ case INTR_ATIO_QUE_UPDATE_27XX:
+- case INTR_ATIO_QUE_UPDATE:{
+- unsigned long flags2;
+- spin_lock_irqsave(&ha->tgt.atio_lock, flags2);
+- qlt_24xx_process_atio_queue(vha, 1);
+- spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2);
++ case INTR_ATIO_QUE_UPDATE:
++ process_atio = true;
+ break;
+- }
+- case INTR_ATIO_RSP_QUE_UPDATE: {
+- unsigned long flags2;
+- spin_lock_irqsave(&ha->tgt.atio_lock, flags2);
+- qlt_24xx_process_atio_queue(vha, 1);
+- spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2);
+-
++ case INTR_ATIO_RSP_QUE_UPDATE:
++ process_atio = true;
+ qla24xx_process_response_queue(vha, rsp);
+ break;
+- }
+ default:
+ ql_dbg(ql_dbg_async, vha, 0x5051,
+ "Unrecognized interrupt type (%d).\n", stat & 0xff);
+@@ -3338,6 +3328,12 @@ qla24xx_msix_default(int irq, void *dev_id)
+ qla2x00_handle_mbx_completion(ha, status);
+ spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
++ if (process_atio) {
++ spin_lock_irqsave(&ha->tgt.atio_lock, flags);
++ qlt_24xx_process_atio_queue(vha, 0);
++ spin_unlock_irqrestore(&ha->tgt.atio_lock, flags);
++ }
++
+ return IRQ_HANDLED;
+ }
+
+
diff --git a/series.conf b/series.conf
index 3371b15e11..43aaf8469a 100644
--- a/series.conf
+++ b/series.conf
@@ -24116,6 +24116,7 @@
patches.drivers/0001-pci-aspm-fix-link_state-teardown-on-device-removal
patches.drivers/0002-pci-aspm-do-not-initialize-link-state-when-aspm_disabled-is-set
patches.drivers/pci-vmd-detach-resources-after-stopping-root-bus
+ patches.fixes/scsi-qla2xxx-fix-deadlock-between-atio-and-hw-lock.patch
patches.drivers/scsi-mpt3sas-add-ioc_-level-logging-macros
patches.drivers/scsi-mpt3sas-convert-uses-of-pr_-level-with-mpt3sas_fmt-to-ioc_-level
patches.drivers/scsi-mpt3sas-convert-mlsleading-uses-of-pr_-level-with-mpt3sas_fmt