aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-01-04 07:45:20 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2006-01-14 11:54:44 -0500
commitd4054239929479907f20b9d68c905589125ad343 (patch)
tree09b02453ac3adde7df61ad32f684996f0329874e /drivers/scsi
parent745caf71d99c5d4ff4c9e4c0f74e64c429fed531 (diff)
[SCSI] sas: fix removal of devices behind expanders
We need to iterate over all children when removing and expander, else stale objects will be around after host removal. This fixes the oops Eric Moore saw when removing and reloading mptsas. Also don't try the scsi_remove_target call unless operating on an end device. The current unconditional call is harmless but confusing. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_transport_sas.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 357b52f5f996..e950435a11d8 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -687,7 +687,17 @@ sas_rphy_delete(struct sas_rphy *rphy)
687 struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); 687 struct Scsi_Host *shost = dev_to_shost(parent->dev.parent);
688 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 688 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
689 689
690 scsi_remove_target(dev); 690 switch (rphy->identify.device_type) {
691 case SAS_END_DEVICE:
692 scsi_remove_target(dev);
693 break;
694 case SAS_EDGE_EXPANDER_DEVICE:
695 case SAS_FANOUT_EXPANDER_DEVICE:
696 device_for_each_child(dev, NULL, do_sas_phy_delete);
697 break;
698 default:
699 break;
700 }
691 701
692 transport_remove_device(dev); 702 transport_remove_device(dev);
693 device_del(dev); 703 device_del(dev);