linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aic94xx: fix hotplug/unplug for expanderless systems
@ 2006-08-28 22:22 Alexis Bruemmer
  2006-08-28 23:06 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Alexis Bruemmer @ 2006-08-28 22:22 UTC (permalink / raw)
  To: linux-scsi

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 <alexisb@us.ibm.com>

---

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
--- linux-2.6.18-rc5-aic94xx-orig/drivers/scsi/libsas/sas_discover.c	2006-08-28 14:29:30.000000000 -0700
+++ linux-2.6.18-rc5-aic94xx-new/drivers/scsi/libsas/sas_discover.c	2006-08-28 14:18:19.000000000 -0700
@@ -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]);
-}
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
--- linux-2.6.18-rc5-aic94xx-orig/drivers/scsi/libsas/sas_port.c	2006-08-28 14:29:30.000000000 -0700
+++ linux-2.6.18-rc5-aic94xx-new/drivers/scsi/libsas/sas_port.c	2006-08-28 14:32:50.000000000 -0700
@@ -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
diff -pNaur linux-2.6.18-rc5-aic94xx-orig/include/scsi/libsas.h linux-2.6.18-rc5-aic94xx-new/include/scsi/libsas.h
--- linux-2.6.18-rc5-aic94xx-orig/include/scsi/libsas.h	2006-08-28 14:29:30.000000000 -0700
+++ linux-2.6.18-rc5-aic94xx-new/include/scsi/libsas.h	2006-08-28 14:18:20.000000000 -0700
@@ -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_ */



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] aic94xx: fix hotplug/unplug for expanderless systems
  2006-08-28 22:22 [PATCH] aic94xx: fix hotplug/unplug for expanderless systems Alexis Bruemmer
@ 2006-08-28 23:06 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2006-08-28 23:06 UTC (permalink / raw)
  To: Alexis Bruemmer; +Cc: linux-scsi

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

--D

Acked-by: Darrick J. Wong <djwong@us.ibm.com>

Alexis Bruemmer wrote:
> This patch fixes hotplug/unplug for expanderless systems by not queuing
> an event just to do sas_unregister_domain_devices.
> 
> -Alexis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-28 23:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-28 22:22 [PATCH] aic94xx: fix hotplug/unplug for expanderless systems Alexis Bruemmer
2006-08-28 23:06 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).