From: Mike Anderson <andmike@us.ibm.com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH 2/5] scsi host / scsi target state model update
Date: Thu, 16 Jun 2005 11:13:42 -0700 [thread overview]
Message-ID: <20050616181342.GC20923@us.ibm.com> (raw)
In-Reply-To: <20050616181238.GB20923@us.ibm.com>
Remove the old scsi_host_cancel function as it has not been working for
sometime do to the device list possibly being empty when it is called and
possible race issues. Add setting of SHOST_CANCEL at the state of beginning
of scsi_remove_host.
Signed-off-by: Mike Anderson <andmike@us.ibm.com>
---
linux-2.6.12-rc6-mm1-andmike/drivers/scsi/hosts.c | 18 +-----------------
linux-2.6.12-rc6-mm1-andmike/drivers/scsi/scsi.c | 2 +-
2 files changed, 2 insertions(+), 18 deletions(-)
diff -puN drivers/scsi/hosts.c~host_cancel drivers/scsi/hosts.c
--- linux-2.6.12-rc6-mm1/drivers/scsi/hosts.c~host_cancel 2005-06-16 10:43:44.000000000 -0700
+++ linux-2.6.12-rc6-mm1-andmike/drivers/scsi/hosts.c 2005-06-16 10:45:21.000000000 -0700
@@ -128,29 +128,13 @@ int scsi_host_set_state(struct Scsi_Host
EXPORT_SYMBOL(scsi_host_set_state);
/**
- * scsi_host_cancel - cancel outstanding IO to this host
- * @shost: pointer to struct Scsi_Host
- * recovery: recovery requested to run.
- **/
-static void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
-{
- struct scsi_device *sdev;
-
- scsi_host_set_state(shost, SHOST_CANCEL);
- shost_for_each_device(sdev, shost) {
- scsi_device_cancel(sdev, recovery);
- }
- wait_event(shost->host_wait, (shost->shost_state != SHOST_RECOVERY));
-}
-
-/**
* scsi_remove_host - remove a scsi host
* @shost: a pointer to a scsi host to remove
**/
void scsi_remove_host(struct Scsi_Host *shost)
{
+ scsi_host_set_state(shost, SHOST_CANCEL);
scsi_forget_host(shost);
- scsi_host_cancel(shost, 0);
scsi_proc_host_rm(shost);
scsi_host_set_state(shost, SHOST_DEL);
diff -puN drivers/scsi/scsi.c~host_cancel drivers/scsi/scsi.c
--- linux-2.6.12-rc6-mm1/drivers/scsi/scsi.c~host_cancel 2005-06-16 10:43:44.000000000 -0700
+++ linux-2.6.12-rc6-mm1-andmike/drivers/scsi/scsi.c 2005-06-16 10:43:44.000000000 -0700
@@ -632,7 +632,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *
spin_lock_irqsave(host->host_lock, flags);
scsi_cmd_get_serial(host, cmd);
- if (unlikely(host->shost_state == SHOST_CANCEL)) {
+ if (unlikely(host->shost_state == SHOST_DEL)) {
cmd->result = (DID_NO_CONNECT << 16);
scsi_done(cmd);
} else {
_
next prev parent reply other threads:[~2005-06-16 18:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-16 18:10 [PATCH 0/5] scsi host / scsi target state model update Mike Anderson
2005-06-16 18:12 ` [PATCH 1/5] " Mike Anderson
2005-06-16 18:13 ` Mike Anderson [this message]
2005-06-16 18:14 ` [PATCH 3/5] " Mike Anderson
2005-06-16 18:15 ` [PATCH 4/5] " Mike Anderson
2005-06-16 18:16 ` [PATCH 5/5] " Mike Anderson
2005-07-12 16:44 ` [PATCH 4/5] " James Bottomley
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=20050616181342.GC20923@us.ibm.com \
--to=andmike@us.ibm.com \
--cc=linux-scsi@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 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.