linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 07/13] aacraid: move scsi_(block,unblock)_requests out of _aac_reset_adapter()
Date: Fri, 28 Feb 2020 08:53:12 +0100	[thread overview]
Message-ID: <20200228075318.91255-8-hare@suse.de> (raw)
In-Reply-To: <20200228075318.91255-1-hare@suse.de>

_aac_reset_adapter() only has one caller, and that one already calls
scsi_block_requests(). So move the calls out of _aac_reset_adapter()
to avoid calling scsi_block_requests() twice.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Balsundar P < Balsundar.P@microchip.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/aacraid/commsup.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 8736a540a048..0d8c1ee40759 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1476,7 +1476,7 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
 {
 	int index, quirks;
 	int retval;
-	struct Scsi_Host *host;
+	struct Scsi_Host *host = aac->scsi_host_ptr;
 	struct scsi_device *dev;
 	int jafo = 0;
 	int bled;
@@ -1493,8 +1493,6 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
 	 *	- The card is dead, or will be very shortly ;-/ so no new
 	 *	  commands are completing in the interrupt service.
 	 */
-	host = aac->scsi_host_ptr;
-	scsi_block_requests(host);
 	aac_adapter_disable_int(aac);
 	if (aac->thread && aac->thread->pid != current->pid) {
 		spin_unlock_irq(host->host_lock);
@@ -1619,7 +1617,6 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
 
 out:
 	aac->in_reset = 0;
-	scsi_unblock_requests(host);
 
 	/*
 	 * Issue bus rescan to catch any configuration that might have
@@ -1640,7 +1637,7 @@ int aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
 {
 	unsigned long flagv = 0;
 	int retval;
-	struct Scsi_Host * host;
+	struct Scsi_Host * host = aac->scsi_host_ptr;
 	int bled;
 
 	if (spin_trylock_irqsave(&aac->fib_lock, flagv) == 0)
@@ -1658,7 +1655,6 @@ int aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
 	 * target (block maximum 60 seconds). Although not necessary,
 	 * it does make us a good storage citizen.
 	 */
-	host = aac->scsi_host_ptr;
 	scsi_block_requests(host);
 
 	/* Quiesce build, flush cache, write through mode */
@@ -1670,6 +1666,8 @@ int aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
 	retval = _aac_reset_adapter(aac, bled, reset_type);
 	spin_unlock_irqrestore(host->host_lock, flagv);
 
+	scsi_unblock_requests(host);
+
 	if ((forced < 2) && (retval == -ENODEV)) {
 		/* Unwind aac_send_shutdown() IOP_RESET unsupported/disabled */
 		struct fib * fibctx = aac_fib_alloc(aac);
-- 
2.16.4


  parent reply	other threads:[~2020-02-28  7:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28  7:53 [PATCHv8 00/13] scsi: remove legacy cmd_list implementation Hannes Reinecke
2020-02-28  7:53 ` [PATCH 01/13] dpt_i2o: rename adpt_i2o_to_scsi() to adpt_i2o_scsi_complete() Hannes Reinecke
2020-02-28  7:53 ` [PATCH 02/13] scsi: add scsi_host_complete_all_commands() helper Hannes Reinecke
2020-02-28  7:53 ` [PATCH 03/13] dpt_i2o: use scsi_host_complete_all_commands() to abort outstanding commands Hannes Reinecke
2020-02-28  7:53 ` [PATCH 04/13] aacraid: Do not wait for outstanding write commands on synchronize_cache Hannes Reinecke
2020-02-28  7:53 ` [PATCH 05/13] aacraid: use scsi_host_complete_all_commands() to terminate outstanding commands Hannes Reinecke
2020-02-28  7:53 ` [PATCH 06/13] aacraid: replace aac_flush_ios() with midlayer helper Hannes Reinecke
2020-02-28  7:53 ` Hannes Reinecke [this message]
2020-02-28  7:53 ` [PATCH 08/13] scsi: add scsi_host_(block,unblock) helper function Hannes Reinecke
2020-02-28  7:53 ` [PATCH 09/13] aacraid: use scsi_host_(block,unblock) to block I/O Hannes Reinecke
2020-02-28  7:53 ` [PATCH 10/13] scsi: add scsi_host_busy_iter() Hannes Reinecke
2020-02-28  7:53 ` [PATCH 11/13] aacraid: use scsi_host_busy_iter() to wait for outstanding commands Hannes Reinecke
2020-02-28  7:53 ` [PATCH 12/13] aacraid: use scsi_host_busy_iter() in get_num_of_incomplete_fibs() Hannes Reinecke
2020-02-28  7:53 ` [PATCH 13/13] scsi: Remove cmd_list functionality Hannes Reinecke
2020-02-29  1:57 ` [PATCHv8 00/13] scsi: remove legacy cmd_list implementation Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2020-02-13 14:04 [PATCHv7 " Hannes Reinecke
2020-02-13 14:04 ` [PATCH 07/13] aacraid: move scsi_(block,unblock)_requests out of _aac_reset_adapter() Hannes Reinecke
2020-02-26 17:42   ` Christoph Hellwig
2019-12-04 14:59 [PATCHv6 00/13] scsi: remove legacy cmd_list implementation Hannes Reinecke
2019-12-04 14:59 ` [PATCH 07/13] aacraid: move scsi_(block,unblock)_requests out of _aac_reset_adapter() Hannes Reinecke
2019-12-10  5:00   ` Balsundar.P

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=20200228075318.91255-8-hare@suse.de \
    --to=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).