Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2018-10-12 12:19:37 +0200
committerHannes Reinecke <hare@suse.de>2018-10-12 12:40:42 +0200
commit8e38f2aed67baf7d159eb6922a901fdc8b5db2da (patch)
tree128b85abe714ba528db6694467476aea43820483
parent50fe149ecda02d129659b6e270a6c0eca1145cd6 (diff)
scsi: qla2xxx: Return switch command on a timeout (bsc#1108870).
-rw-r--r--patches.fixes/scsi-qla2xxx-Return-switch-command-on-a-timeout.patch67
-rw-r--r--series.conf1
2 files changed, 68 insertions, 0 deletions
diff --git a/patches.fixes/scsi-qla2xxx-Return-switch-command-on-a-timeout.patch b/patches.fixes/scsi-qla2xxx-Return-switch-command-on-a-timeout.patch
new file mode 100644
index 0000000000..6993df1f24
--- /dev/null
+++ b/patches.fixes/scsi-qla2xxx-Return-switch-command-on-a-timeout.patch
@@ -0,0 +1,67 @@
+From: Himanshu Madhani <himanshu.madhani@cavium.com>
+Date: Fri, 28 Sep 2018 11:02:38 -0700
+Subject: [PATCH] scsi: qla2xxx: Return switch command on a timeout
+Git-commit: ef801f07e7b3cc1786d8ab1b4fdf069cc2a136d2
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
+Patch-mainline: Queued in subsystem maintainer repository
+References: bsc#1108870
+
+This patch fixes commit bcc71cc3cde1 ("scsi: qla2xxx: Fix for double
+free of SRB structure") which placed code in wrong routines.
+
+Also updated the use of WARN_ON() to WARN_ON_ONCE() to prevent
+flooding log messages.
+
+Fixes: bcc71cc3cde1 ("scsi: qla2xxx: Fix for double free of SRB structure")
+Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Acked-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/scsi/qla2xxx/qla_init.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
+index ea7951eb05ce..c72d8012fe2a 100644
+--- a/drivers/scsi/qla2xxx/qla_init.c
++++ b/drivers/scsi/qla2xxx/qla_init.c
+@@ -54,7 +54,7 @@ qla2x00_sp_timeout(struct timer_list *t)
+ unsigned long flags;
+ struct qla_hw_data *ha = sp->vha->hw;
+
+- WARN_ON(irqs_disabled());
++ WARN_ON_ONCE(irqs_disabled());
+ spin_lock_irqsave(&ha->hardware_lock, flags);
+ req = sp->qpair->req;
+ req->outstanding_cmds[sp->handle] = NULL;
+@@ -792,6 +792,9 @@ qla24xx_async_gnl_sp_done(void *s, int res)
+ sp->name, res, sp->u.iocb_cmd.u.mbx.in_mb[1],
+ sp->u.iocb_cmd.u.mbx.in_mb[2]);
+
++ if (res == QLA_FUNCTION_TIMEOUT)
++ return;
++
+ sp->fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE);
+ memset(&ea, 0, sizeof(ea));
+ ea.sp = sp;
+@@ -974,17 +977,13 @@ void qla24xx_async_gpdb_sp_done(void *s, int res)
+ "Async done-%s res %x, WWPN %8phC mb[1]=%x mb[2]=%x \n",
+ sp->name, res, fcport->port_name, mb[1], mb[2]);
+
+- fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
+-
+- if (res == QLA_FUNCTION_TIMEOUT)
+- return;
+-
+ if (res == QLA_FUNCTION_TIMEOUT) {
+ dma_pool_free(sp->vha->hw->s_dma_pool, sp->u.iocb_cmd.u.mbx.in,
+ sp->u.iocb_cmd.u.mbx.in_dma);
+ return;
+ }
+
++ fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
+ memset(&ea, 0, sizeof(ea));
+ ea.event = FCME_GPDB_DONE;
+ ea.fcport = fcport;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 4d0c949ef9..01c5959f31 100644
--- a/series.conf
+++ b/series.conf
@@ -17929,6 +17929,7 @@
patches.fixes/scsi-qla2xxx-Fix-recursive-mailbox-timeout.patch
patches.fixes/scsi-qla2xxx-Fix-for-double-free-of-SRB-structure.patch
patches.fixes/scsi-qla2xxx-Move-log-messages-before-issuing-comman.patch
+ patches.fixes/scsi-qla2xxx-Return-switch-command-on-a-timeout.patch
# git://git.infradead.org/nvme.git nvme-4.20
patches.fixes/nvme_fc-add-nvme_discovery-sysfs-attribute-to-fc-tra.patch