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

[Xen-devel] [PATCH 6/10] linux 2.6.18: change pcifront locking



pci_bus_sem is getting acquired by free_root_bus_devs() exclusively for
lookup purposes in my understanding, hence it can be a read acquire,
not a write one.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: head-2007-02-27/drivers/xen/pcifront/pci_op.c
===================================================================
--- head-2007-02-27.orig/drivers/xen/pcifront/pci_op.c  2007-03-05 
10:00:18.000000000 +0100
+++ head-2007-02-27/drivers/xen/pcifront/pci_op.c       2007-02-27 
16:27:37.000000000 +0100
@@ -239,17 +239,17 @@ static void free_root_bus_devs(struct pc
 {
        struct pci_dev *dev;
 
-       down_write(&pci_bus_sem);
+       down_read(&pci_bus_sem);
        while (!list_empty(&bus->devices)) {
                dev = container_of(bus->devices.next, struct pci_dev, bus_list);
-               up_write(&pci_bus_sem);
+               up_read(&pci_bus_sem);
 
                dev_dbg(&dev->dev, "removing device\n");
                pci_remove_bus_device(dev);
 
-               down_write(&pci_bus_sem);
+               down_read(&pci_bus_sem);
        }
-       up_write(&pci_bus_sem);
+       up_read(&pci_bus_sem);
 }
 
 void pcifront_free_roots(struct pcifront_device *pdev)



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.