All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <Martin.Wilck@suse.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Himanshu Madhani <hmadhani@marvell.com>,
	Quinn Tran <qutran@marvell.com>
Cc: Bart Van Assche <Bart.VanAssche@sandisk.com>,
	Hannes Reinecke <hare@suse.de>,
	Martin Wilck <Martin.Wilck@suse.com>,
	Daniel Wagner <dwagner@suse.de>,
	James Bottomley <jejb@linux.vnet.ibm.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: [PATCH 2/2] scsi: qla2xxx: don't shut down firmware before closing sessions
Date: Fri, 29 Nov 2019 20:26:36 +0000	[thread overview]
Message-ID: <20191129202627.19624-2-martin.wilck@suse.com> (raw)
In-Reply-To: <20191129202627.19624-1-martin.wilck@suse.com>

From: Martin Wilck <mwilck@suse.com>

Since 45235022da99, the firmware is shut down early in the controller
shutdown process. This causes commands sent to the firmware (such as LOGO)
to hang forever. Eventually one or more timeouts will be triggered.
Move the stopping of the firmware until after sessions have terminated.

Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip")
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 drivers/scsi/qla2xxx/qla_os.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 43d0aa0..0cc127d 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3710,6 +3710,16 @@ qla2x00_remove_one(struct pci_dev *pdev)
 	}
 	qla2x00_wait_for_hba_ready(base_vha);
 
+	qla2x00_wait_for_sess_deletion(base_vha);
+
+	/*
+	 * if UNLOAD flag is already set, then continue unload,
+	 * where it was set first.
+	 */
+	if (test_bit(UNLOADING, &base_vha->dpc_flags))
+		return;
+
+	set_bit(UNLOADING, &base_vha->dpc_flags);
 	if (IS_QLA25XX(ha) || IS_QLA2031(ha) || IS_QLA27XX(ha) ||
 	    IS_QLA28XX(ha)) {
 		if (ha->flags.fw_started)
@@ -3726,17 +3736,6 @@ qla2x00_remove_one(struct pci_dev *pdev)
 		qla2x00_try_to_stop_firmware(base_vha);
 	}
 
-	qla2x00_wait_for_sess_deletion(base_vha);
-
-	/*
-	 * if UNLOAD flag is already set, then continue unload,
-	 * where it was set first.
-	 */
-	if (test_bit(UNLOADING, &base_vha->dpc_flags))
-		return;
-
-	set_bit(UNLOADING, &base_vha->dpc_flags);
-
 	qla_nvme_delete(base_vha);
 
 	dma_free_coherent(&ha->pdev->dev,
-- 
2.24.0


  reply	other threads:[~2019-11-29 20:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29 20:26 [PATCH 1/2] scsi: qla2xxx: avoid sending mailbox commands if firmware is stopped Martin Wilck
2019-11-29 20:26 ` Martin Wilck [this message]
2019-11-30 10:23   ` [PATCH 2/2] scsi: qla2xxx: don't shut down firmware before closing sessions Roman Bolshakov
2020-02-05  9:10     ` Martin Wilck
2019-12-03  7:52   ` Hannes Reinecke
2019-12-11 12:06   ` Bart Van Assche
2019-11-30  9:57 ` [PATCH 1/2] scsi: qla2xxx: avoid sending mailbox commands if firmware is stopped Roman Bolshakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191129202627.19624-2-martin.wilck@suse.com \
    --to=martin.wilck@suse.com \
    --cc=Bart.VanAssche@sandisk.com \
    --cc=dwagner@suse.de \
    --cc=hare@suse.de \
    --cc=hmadhani@marvell.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=qutran@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.