aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libsas/sas_discover.c8
-rw-r--r--drivers/scsi/libsas/sas_port.c4
-rw-r--r--include/scsi/libsas.h2
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index 789b50861bb9..b91866a8233b 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)
299 } 299 }
300} 300}
301 301
302void sas_unregister_domain_devices(struct asd_sas_port *port) 302void sas_unregister_domain_devices(struct asd_sas_port *port, int gone)
303{ 303{
304 struct domain_device *dev, *n; 304 struct domain_device *dev, *n;
305 305
306 list_for_each_entry_safe_reverse(dev, n, &port->dev_list, dev_list_node) 306 list_for_each_entry_safe_reverse(dev, n, &port->dev_list, dev_list_node) {
307 if (gone)
308 set_bit(SAS_DEV_GONE, &dev->state);
307 sas_unregister_dev(port, dev); 309 sas_unregister_dev(port, dev);
310 }
311
308 list_for_each_entry_safe(dev, n, &port->disco_list, disco_list_node) 312 list_for_each_entry_safe(dev, n, &port->disco_list, disco_list_node)
309 sas_unregister_dev(port, dev); 313 sas_unregister_dev(port, dev);
310 314
diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c
index 31adcd1b4191..59ee8a0a6ea9 100644
--- a/drivers/scsi/libsas/sas_port.c
+++ b/drivers/scsi/libsas/sas_port.c
@@ -167,9 +167,7 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone)
167 dev->pathways--; 167 dev->pathways--;
168 168
169 if (port->num_phys == 1) { 169 if (port->num_phys == 1) {
170 if (dev && gone) 170 sas_unregister_domain_devices(port, gone);
171 set_bit(SAS_DEV_GONE, &dev->state);
172 sas_unregister_domain_devices(port);
173 sas_port_delete(port->port); 171 sas_port_delete(port->port);
174 port->port = NULL; 172 port->port = NULL;
175 } else { 173 } else {
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 55bab8633807..4a42be34fad0 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -664,7 +664,7 @@ void sas_init_ex_attr(void);
664 664
665int sas_ex_revalidate_domain(struct domain_device *); 665int sas_ex_revalidate_domain(struct domain_device *);
666 666
667void sas_unregister_domain_devices(struct asd_sas_port *port); 667void sas_unregister_domain_devices(struct asd_sas_port *port, int gone);
668void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *); 668void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *);
669int sas_discover_event(struct asd_sas_port *, enum discover_event ev); 669int sas_discover_event(struct asd_sas_port *, enum discover_event ev);
670 670