public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Justin T. Gibbs" <gibbs@scsiguy.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Fix scsi_unblock_requests()
Date: Tue, 10 Apr 2001 09:02:43 -0600	[thread overview]
Message-ID: <200104101502.f3AF2hs31410@aslan.scsiguy.com> (raw)

In its current implementation, scsi_unblock_requests() simply
clears host_self_blocked in the SCSI host struct.  This means
that either a transaction must complete or a new transaction
be issued before the mid-layer will recognize that it can
run the queues.  There is no guarantee that either of these
events will ever happen.

This patch attempts to run the queues manually when the host
unblocks.  scsi_queue_next_request() verifies all other state
to ensure queuing new transactions is safe prior to proceeding.

This patch is part of versions 6.1.10 and 6.1.11 of the
aic7xxx driver.  Its used, along with scsi_block_requests(), to
hold off the mid-layer during the initial bus settle delay without
resorting to a busy loop.

--
Justin

diff -u -r -N linux-2.4.3.virgin/drivers/scsi/scsi_lib.c linux-2.4.3/drivers/scsi/scsi_lib.c
--- linux-2.4.3.virgin/drivers/scsi/scsi_lib.c	Fri Mar  2 19:38:39 2001
+++ linux-2.4.3/drivers/scsi/scsi_lib.c	Thu Apr  5 14:28:17 2001
@@ -1108,9 +1108,13 @@
  */
 void scsi_unblock_requests(struct Scsi_Host * SHpnt)
 {
+	Scsi_Device *SDloop;
+
 	SHpnt->host_self_blocked = FALSE;
+	/* Now that we are unblocked, try to start the queues. */
+	for (SDloop = SHpnt->host_queue; SDloop; SDloop = SDloop->next)
+		scsi_queue_next_request(&SDloop->request_queue, NULL);
 }
-
 
 /*
  * Function:    scsi_report_bus_reset()

             reply	other threads:[~2001-04-10 15:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 15:02 Justin T. Gibbs [this message]
2001-04-10 16:06 ` [PATCH] Fix scsi_unblock_requests() Alan Cox
2001-04-10 17:10   ` Justin T. Gibbs

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=200104101502.f3AF2hs31410@aslan.scsiguy.com \
    --to=gibbs@scsiguy.com \
    --cc=linux-kernel@vger.kernel.org \
    /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