[PATCH 2/2] aic94xx: ref count update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allow aic94xx driver to unloaded and load.

Signed-off-by: Mike Anderson <andmike@xxxxxxxxxx>
Signed-off-by: Alexis Bruemmer <alexisb@xxxxxxxxxx>

 drivers/scsi/sas/sas_discover.c  |    2 ++
 drivers/scsi/sas/sas_init.c      |    2 --
 drivers/scsi/sas/sas_scsi_host.c |    1 +
 include/scsi/sas/sas_discover.h  |    3 ---
 4 files changed, 3 insertions(+), 5 deletions(-)

Index: aic94xx-sas-2.6-patched/include/scsi/sas/sas_discover.h
===================================================================
--- aic94xx-sas-2.6-patched.orig/include/scsi/sas/sas_discover.h	2006-03-22 13:22:22.000000000 -0800
+++ aic94xx-sas-2.6-patched/include/scsi/sas/sas_discover.h	2006-03-22 13:24:39.000000000 -0800
@@ -128,8 +128,6 @@ static inline int sas_notify_lldd_dev_fo
 	int res = 0;
 	struct sas_ha_struct *sas_ha = dev->port->ha;
 
-	if (!try_module_get(sas_ha->lldd_module))
-		return -ENOMEM;
 	if (sas_ha->lldd_dev_found) {
 		res = sas_ha->lldd_dev_found(dev);
 		if (res) {
@@ -146,7 +144,6 @@ static inline void sas_notify_lldd_dev_g
 {
 	if (dev->port->ha->lldd_dev_gone)
 		dev->port->ha->lldd_dev_gone(dev);
-	module_put(dev->port->ha->lldd_module);
 }
 
 static inline void sas_init_dev(struct domain_device *dev)
Index: aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_scsi_host.c
===================================================================
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_scsi_host.c	2006-03-22 13:22:22.000000000 -0800
+++ aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_scsi_host.c	2006-03-22 13:24:39.000000000 -0800
@@ -693,6 +693,7 @@ out_err:
 
 void sas_unregister_scsi_host(struct sas_ha_struct *sas_ha)
 {
+	sas_remove_host(sas_ha->core.shost);
 	scsi_remove_host(sas_ha->core.shost);
 	scsi_host_put(sas_ha->core.shost);
 	sas_ha->core.shost = NULL;
Index: aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_init.c
===================================================================
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_init.c	2006-03-22 13:22:22.000000000 -0800
+++ aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_init.c	2006-03-22 13:24:39.000000000 -0800
@@ -108,8 +108,6 @@ Undo:
 
 int sas_unregister_ha(struct sas_ha_struct *sas_ha)
 {
-	sas_unregister_devices(sas_ha);
-
 	if (sas_ha->lldd_max_execute_num > 1) {
 		sas_shutdown_queue(sas_ha);
 	}
Index: aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_discover.c
===================================================================
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_discover.c	2006-03-22 13:22:22.000000000 -0800
+++ aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_discover.c	2006-03-22 13:24:39.000000000 -0800
@@ -591,6 +591,8 @@ static void sas_unregister_domain_device
 
 	list_for_each_entry_reverse_safe(dev,n,&port->dev_list,dev_list_node)
 		sas_unregister_dev(dev);
+
+	complete(&port->port_gone_completion);
 }
 
 /* ---------- Discovery and Revalidation ---------- */
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux