From: James Bottomley <James.Bottomley@SteelEye.com>
To: Christian Iversen <chrivers@iversen-net.dk>
Cc: linux-scsi <linux-scsi@vger.kernel.org>
Subject: (added subject) RE: USB oops in scsi_host_cancel
Date: 18 Nov 2004 17:40:41 -0600 [thread overview]
Message-ID: <1100821249.1574.42.camel@mulgrave> (raw)
In-Reply-To: <200411181952.46993.chrivers@iversen-net.dk>
On Thu, 2004-11-18 at 12:52, Christian Iversen wrote:
> I have a bug to report. I previously wrote (on linux-usb-devel) about problems
> with http://bugme.osdl.org/show_bug.cgi?id=3728, which has now been fixed.
> However, the world is not trouble-free yet, as linux still crashes in certain
> situations on 2.6.10-rc2 with SMP systems. (UP systems are fine).
>
> The new bug is http://bugme.osdl.org/show_bug.cgi?id=3761, which I marked as
> "blocking" because it's very easy to bring the whole system down.
>
> Could someone smart please take a look at the dmesg I attached
> to the bug post? Particularly, what the foo is going on here: ?
>
> usb 4-2: USB disconnect, address 2
> usb 4-2.3: USB disconnect, address 5
> target5:0:0: Illegal state transition <NULL>->cancel
> Badness in scsi_device_set_state at drivers/scsi/scsi_lib.c:1717
> [<b0324d16>] scsi_device_set_state+0xc6/0x130
> [<b031fcaa>] scsi_device_cancel+0x2a/0x106
> [<b031fe10>] scsi_device_cancel_cb+0x0/0x20
> [<b02f128e>] device_for_each_child+0x3e/0x70
Well, Oops. The I posted the patch to fix this a while ago (it was
subsequently modified by Mike Christie). Apparently I put Mike's update
in the BK tree, but not my own initial patch (I suppose dropping other
people's patches can be considered unfortunate, but dropping your own
looks like carelessness).
Anyway, the attached should fix it, if you give it a whirl.
James
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/11/18 17:00:19-06:00 jejb@mulgrave.(none)
# SCSI: fix USB forced remove oops
#
# Because of the changes to add the target in to the
# driver model, the cancellation method no-longer works
# correctly.
#
# Fix it by iterating using shost_for_each_device instead.
#
# Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
#
# drivers/scsi/hosts.c
# 2004/11/18 16:59:11-06:00 jejb@mulgrave.(none) +5 -7
# SCSI: fix USB forced remove oops
#
diff -Nru a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
--- a/drivers/scsi/hosts.c 2004-11-18 17:38:59 -06:00
+++ b/drivers/scsi/hosts.c 2004-11-18 17:38:59 -06:00
@@ -50,11 +50,6 @@
.release = scsi_host_cls_release,
};
-static int scsi_device_cancel_cb(struct device *dev, void *data)
-{
- return scsi_device_cancel(to_scsi_device(dev), *(int *)data);
-}
-
/**
* scsi_host_cancel - cancel outstanding IO to this host
* @shost: pointer to struct Scsi_Host
@@ -62,9 +57,12 @@
**/
void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
{
+ struct scsi_device *sdev;
+
set_bit(SHOST_CANCEL, &shost->shost_state);
- device_for_each_child(&shost->shost_gendev, &recovery,
- scsi_device_cancel_cb);
+ shost_for_each_device(sdev, shost) {
+ scsi_device_cancel(sdev, recovery);
+ }
wait_event(shost->host_wait, (!test_bit(SHOST_RECOVERY,
&shost->shost_state)));
}
prev parent reply other threads:[~2004-11-18 23:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-18 18:52 (unknown) Christian Iversen
2004-11-18 23:40 ` James Bottomley [this message]
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=1100821249.1574.42.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=chrivers@iversen-net.dk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox