aic94xx: fix hotplug/unplug for expanderless systems
Subsystems (2)
PATCH 1/1 aic94xx: fix hotplug/unplug for expanderless systems
This patch fixes hotplug/unplug for expanderless systems by not queuing an event just to do sas_unregister_domain_devices.
-Alexis
Signed-off-by Alexis Bruemmer <[email protected]>
---
drivers/scsi/libsas/sas_discover.c +1 -15
@@ -625,20 +625,15 @@ void sas_unregister_dev(struct domain_desas_unregister_common_dev (dev); } -static void sas_unregister_domain_devices (void *data) +void sas_unregister_domain_devices (struct asd_sas_port *port) {struct domain_device *dev, *n; -struct asd_sas_port *port = data; - -sas_begin_event (DISCE_PORT_GONE , &port->disc.disc_event_lock, - &port->disc.pending);list_for_each_entry_safe_reverse (dev,n,&port->dev_list,dev_list_node)sas_unregister_dev (dev); port->port->rphy =NULL ; -complete (&port->port_gone_completion); }/* ---------- Discovery and Revalidation ---------- */
@@ -745,7 +740,6 @@ void sas_init_disc(struct sas_discoverystatic void (*sas_event_fns[DISC_NUM_EVENTS ])(void *) = { [DISCE_DISCOVER_DOMAIN ] = sas_discover_domain, [DISCE_REVALIDATE_DOMAIN ] = sas_revalidate_domain, - [DISCE_PORT_GONE ] = sas_unregister_domain_devices, };spin_lock_init (&disc->disc_event_lock);
@@ -753,11 +747,3 @@ void sas_init_disc(struct sas_discoveryfor (i =0 ; i <DISC_NUM_EVENTS ; i++)INIT_WORK (&disc->disc_work[i], sas_event_fns[i], port); } - -void sas_unregister_devices (struct sas_ha_struct *sas_ha) -{ -int i; - -for (i =0 ; i < sas_ha->num_phys; i++) -sas_unregister_domain_devices (sas_ha->sas_port[i]); -}
drivers/scsi/libsas/sas_port.c +1 -3
@@ -145,9 +145,7 @@ void sas_deform_port(struct asd_sas_phy port->port_dev->pathways--;if (port->num_phys ==1 ) { -init_completion (&port->port_gone_completion); -sas_discover_event (port,DISCE_PORT_GONE ); -wait_for_completion (&port->port_gone_completion); +sas_unregister_domain_devices (port);sas_port_delete (port->port); port->port =NULL ; }else
include/scsi/libsas.h +1 -3
@@ -613,7 +613,7 @@ void sas_init_ex_attr(void);int sas_ex_revalidate_domain (struct domain_device *); - +void sas_unregister_domain_devices (struct asd_sas_port *port);void sas_init_disc (struct sas_discovery *disc,struct asd_sas_port *);int sas_discover_event (struct asd_sas_port *,enum discover_event ev);
@@ -622,8 +622,6 @@ int sas_discover_end_dev(struct domain_void sas_unregister_dev (struct domain_device *); -void sas_unregister_devices (struct sas_ha_struct *); -void sas_init_dev (struct domain_device *);#endif /* _SASLIB_H_ */
Works quite nicely with my SATA/SAS disks/machines too.
--D
Acked-by Darrick J. Wong <[email protected]>
Quoted 4 lines · Alexis Bruemmer
This patch fixes hotplug/unplug for expanderless systems by not queuing an event just to do
sas_unregister_domain_devices.-Alexis