]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] libsas: fix lockdep issue with ATA
authorJames Bottomley <James.Bottomley@steeleye.com>
Mon, 16 Jul 2007 18:15:51 +0000 (13:15 -0500)
committerJames Bottomley <jejb@mulgrave.localdomain>
Wed, 18 Jul 2007 16:16:22 +0000 (11:16 -0500)
lockdep noticed that with ATA support the port->dev_list_lock was
entangled at irq context, so it now needs to become IRQ safe

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/libsas/sas_discover.c
drivers/scsi/libsas/sas_expander.c

index 4d768db1b5674ae0e50b0c8d4f0574ccda9ebd48..328a78ad6aa00d693d9f856b0371993e7aae40e7 100644 (file)
@@ -304,9 +304,9 @@ static int sas_get_port_device(struct asd_sas_port *port)
        port->disc.max_level = 0;
 
        dev->rphy = rphy;
-       spin_lock(&port->dev_list_lock);
+       spin_lock_irq(&port->dev_list_lock);
        list_add_tail(&dev->dev_list_node, &port->dev_list);
-       spin_unlock(&port->dev_list_lock);
+       spin_unlock_irq(&port->dev_list_lock);
 
        return 0;
 }
@@ -703,9 +703,9 @@ static void sas_discover_domain(struct work_struct *work)
                sas_rphy_free(dev->rphy);
                dev->rphy = NULL;
 
-               spin_lock(&port->dev_list_lock);
+               spin_lock_irq(&port->dev_list_lock);
                list_del_init(&dev->dev_list_node);
-               spin_unlock(&port->dev_list_lock);
+               spin_unlock_irq(&port->dev_list_lock);
 
                kfree(dev); /* not kobject_register-ed yet */
                port->port_dev = NULL;
index d05fc23b4d5b9dd445357d5a793853e1081be9ed..969fd3eb494a7e3b9045f2c150336fd63dfe42d8 100644 (file)
@@ -677,9 +677,9 @@ static struct domain_device *sas_ex_discover_end_dev(
 
                child->rphy = rphy;
 
-               spin_lock(&parent->port->dev_list_lock);
+               spin_lock_irq(&parent->port->dev_list_lock);
                list_add_tail(&child->dev_list_node, &parent->port->dev_list);
-               spin_unlock(&parent->port->dev_list_lock);
+               spin_unlock_irq(&parent->port->dev_list_lock);
 
                res = sas_discover_sata(child);
                if (res) {
@@ -701,9 +701,9 @@ static struct domain_device *sas_ex_discover_end_dev(
                child->rphy = rphy;
                sas_fill_in_rphy(child, rphy);
 
-               spin_lock(&parent->port->dev_list_lock);
+               spin_lock_irq(&parent->port->dev_list_lock);
                list_add_tail(&child->dev_list_node, &parent->port->dev_list);
-               spin_unlock(&parent->port->dev_list_lock);
+               spin_unlock_irq(&parent->port->dev_list_lock);
 
                res = sas_discover_end_dev(child);
                if (res) {
@@ -816,9 +816,9 @@ static struct domain_device *sas_ex_discover_expander(
        sas_fill_in_rphy(child, rphy);
        sas_rphy_add(rphy);
 
-       spin_lock(&parent->port->dev_list_lock);
+       spin_lock_irq(&parent->port->dev_list_lock);
        list_add_tail(&child->dev_list_node, &parent->port->dev_list);
-       spin_unlock(&parent->port->dev_list_lock);
+       spin_unlock_irq(&parent->port->dev_list_lock);
 
        res = sas_discover_expander(child);
        if (res) {