[PATCH] aic94xx: fix sleep under lock

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

 



Lockdep didn't pick this one up for me, sigh ...

But I noticed the port_alloc/port_add functions are called with locks
held.  Since these may potentially sleep, this is a no-no.  Correct by
moving the calls to outside the locked region.

James

Index: BUILD-2.6/drivers/scsi/sas/sas_port.c
===================================================================
--- BUILD-2.6.orig/drivers/scsi/sas/sas_port.c	2006-07-08 10:40:18.000000000 -0500
+++ BUILD-2.6/drivers/scsi/sas/sas_port.c	2006-07-08 10:43:31.000000000 -0500
@@ -82,13 +82,6 @@
 		return;
 	}
 
-	if (!port->port) {
-		port->port = sas_port_alloc(phy->phy->dev.parent, port->id);
-		BUG_ON(!port->port);
-		sas_port_add(port->port);
-	}
-	sas_port_add_phy(port->port, phy->phy);
-
 	/* add the phy to the port */
 	list_add_tail(&phy->port_phy_el, &port->phy_list);
 	phy->port = port;
@@ -114,6 +107,13 @@
 	spin_unlock(&port->phy_list_lock);
 	spin_unlock(&sas_ha->phy_port_lock);
 
+	if (!port->port) {
+		port->port = sas_port_alloc(phy->phy->dev.parent, port->id);
+		BUG_ON(!port->port);
+		sas_port_add(port->port);
+	}
+	sas_port_add_phy(port->port, phy->phy);
+
 	if (port->port_dev)
 		port->port_dev->pathways = port->num_phys;
 


-
: 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