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/
Home Products Support Community News


[Xen-changelog] [linux-2.6.18-xen] linux/pcifront: claim PCI resources a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] linux/pcifront: claim PCI resources also on rescan
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 04 Oct 2010 05:35:04 -0700
Delivery-date: Mon, 04 Oct 2010 05:37:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1286195433 -3600
# Node ID 37ec32c7b0796687d445291e9d9f0aa265cfd6e1
# Parent  93128220b8cff793943638c7b9048ccf0e0317f8
linux/pcifront: claim PCI resources also on rescan

Condensed from the following two patches:

xen-pcifront: Claim PCI resources before going live.

author  Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>=09
        Fri, 18 Jun 2010 19:31:47 +0000 (15:31 -0400)
committer       Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>=09
        Fri, 18 Jun 2010 19:40:37 +0000 (15:40 -0400)

We were missing the important step of claiming (and setting the
parent of IO and MEM regions to 'PCI IO' and 'PCI mem' respectivly)
of the BARs. This meant that during hot inserts we would get:

igb 0000:01:00.1: device not available (can't reserve [mem

even thought the memory region had been reserved before.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

xen-pcifront: Don't race with udev when discovering new devices.

author  Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>=09
        Fri, 23 Jul 2010 14:35:57 +0000 (10:35 -0400)
committer       Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>=09
        Fri, 23 Jul 2010 15:15:56 +0000 (11:15 -0400)

We inadvertly would call 'pci_bus_add_device' right after discovering
the device, but before claiming the BARs. This ended up firing off
a uevent and udev loading the module and the modules failing to
request_region as they were not claimed. We fix this by holding off
going live by calling 'pci_bus_add_devices' at the end.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Reported-by: Rafal Wojtczuk <rafal@xxxxxxxxxxxxxxxxxxxxxx>
 drivers/xen/pcifront/pci_op.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r 93128220b8cf -r 37ec32c7b079 drivers/xen/pcifront/pci_op.c
--- a/drivers/xen/pcifront/pci_op.c     Sat Oct 02 15:07:00 2010 +0100
+++ b/drivers/xen/pcifront/pci_op.c     Mon Oct 04 13:30:33 2010 +0100
@@ -529,13 +529,17 @@ int __devinit pcifront_rescan_root(struc
                d = pci_scan_single_device(b, devfn);
-               if (d) {
+               if (d)
                        dev_info(&pdev->xdev->dev, "New device on "
                                 "%04x:%02x:%02x.%02x found.\n", domain, bus,
                                 PCI_SLOT(devfn), PCI_FUNC(devfn));
-                       pci_bus_add_device(d);
-               }
-       }
+       }
+       /* Claim resources before going "live" with our devices */
+       pci_walk_bus(b, pcifront_claim_resource, pdev);
+       /* Create SysFS and notify udev of the devices. Aka: "going live" */
+       pci_bus_add_devices(b);
        return 0;

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] linux/pcifront: claim PCI resources also on rescan, Xen patchbot-linux-2.6.18-xen <=