Skip to contentSkip to conversation

aic94xx: fix hotplug/unplug for expanderless systems

PATCH In review Alexis Bruemmer 2 participants 2 messages Aug 28, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

---

drivers/scsi/libsas/sas_discover.c +1 -15
diff -pNaur linux-2.6.18-rc5-aic94xx-orig/drivers/scsi/libsas/sas_discover.c linux-2.6.18-rc5-aic94xx-new/drivers/scsi/libsas/sas_discover.c
@@ -625,20 +625,15 @@ void sas_unregister_dev(struct domain_de
 	sas_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_discovery 
 	static 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_discovery 
 	for (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
diff -pNaur linux-2.6.18-rc5-aic94xx-orig/drivers/scsi/libsas/sas_port.c linux-2.6.18-rc5-aic94xx-new/drivers/scsi/libsas/sas_port.c
@@ -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
diff -pNaur linux-2.6.18-rc5-aic94xx-orig/include/scsi/libsas.h linux-2.6.18-rc5-aic94xx-new/include/scsi/libsas.h
@@ -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_ */
Acked-by on v1 1/1
#1 lore raw

Works quite nicely with my SATA/SAS disks/machines too.

--D

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