diff options
author | Dan Williams <dan.j.williams@intel.com> | 2012-01-10 14:39:13 -0800 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-29 15:20:55 -0600 |
commit | 7d05919aad080074453de880822fe5805875645f (patch) | |
tree | df78c12a7bfc9acaefd91d2a8852dca17c178790 /drivers/scsi/libsas/sas_discover.c | |
parent | 45c73b65194173e77030d5b95abe5b63a402d268 (diff) |
[SCSI] libsas: mark all domain devices gone if root port disappears
If the top level expander is hot removed, mark all child devices as gone
before unregistration to short circuit futile recovery.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_discover.c')
-rw-r--r-- | drivers/scsi/libsas/sas_discover.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 789b50861bb..b91866a8233 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -299,12 +299,16 @@ void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev) } } -void sas_unregister_domain_devices(struct asd_sas_port *port) +void sas_unregister_domain_devices(struct asd_sas_port *port, int gone) { struct domain_device *dev, *n; - list_for_each_entry_safe_reverse(dev, n, &port->dev_list, dev_list_node) + list_for_each_entry_safe_reverse(dev, n, &port->dev_list, dev_list_node) { + if (gone) + set_bit(SAS_DEV_GONE, &dev->state); sas_unregister_dev(port, dev); + } + list_for_each_entry_safe(dev, n, &port->disco_list, disco_list_node) sas_unregister_dev(port, dev); |