1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# 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
#
# http://linux.bkbits.net:8080/linux-2.6/gnupatch@419d2983-_QPP7sTc7_0aEaOfANJKw
#
diff -Naru a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
--- a/drivers/scsi/hosts.c 2005-12-10 04:53:13 -08:00
+++ b/drivers/scsi/hosts.c 2005-12-10 04:53:13 -08: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)));
}
|