Commit 621df624 authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

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: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 26b40e13
...@@ -50,11 +50,6 @@ static struct class shost_class = { ...@@ -50,11 +50,6 @@ static struct class shost_class = {
.release = scsi_host_cls_release, .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 * scsi_host_cancel - cancel outstanding IO to this host
* @shost: pointer to struct Scsi_Host * @shost: pointer to struct Scsi_Host
...@@ -62,9 +57,12 @@ static int scsi_device_cancel_cb(struct device *dev, void *data) ...@@ -62,9 +57,12 @@ static int scsi_device_cancel_cb(struct device *dev, void *data)
**/ **/
void scsi_host_cancel(struct Scsi_Host *shost, int recovery) void scsi_host_cancel(struct Scsi_Host *shost, int recovery)
{ {
struct scsi_device *sdev;
set_bit(SHOST_CANCEL, &shost->shost_state); set_bit(SHOST_CANCEL, &shost->shost_state);
device_for_each_child(&shost->shost_gendev, &recovery, shost_for_each_device(sdev, shost) {
scsi_device_cancel_cb); scsi_device_cancel(sdev, recovery);
}
wait_event(shost->host_wait, (!test_bit(SHOST_RECOVERY, wait_event(shost->host_wait, (!test_bit(SHOST_RECOVERY,
&shost->shost_state))); &shost->shost_state)));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment