WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 6/10] linux 2.6.18: change pcifront locking
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Mon, 05 Mar 2007 11:16:29 +0000
Delivery-date: Mon, 05 Mar 2007 03:17:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 6/10] linux 2.6.18: change pcifront locking, Jan Beulich <=