From: Alex Chiang Date: Fri, 20 Mar 2009 20:56:20 +0000 (-0600) Subject: PCI: do not enable bridges more than once X-Git-Tag: v2.6.30-rc1~419^2~15 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=9dd90cafa7a712d283e2e0c625b022e19f746762;p=safe%2Fjmp%2Flinux-2.6 PCI: do not enable bridges more than once In preparation for PCI core hotplug, we need to ensure that we do not attempt to re-enable bridges that have already been enabled. Reported-by: Kenji Kaneshige Signed-off-by: Alex Chiang Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 118c777..68f91a2 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -184,8 +184,10 @@ void pci_enable_bridges(struct pci_bus *bus) list_for_each_entry(dev, &bus->devices, bus_list) { if (dev->subordinate) { - retval = pci_enable_device(dev); - pci_set_master(dev); + if (atomic_read(&dev->enable_cnt) == 0) { + retval = pci_enable_device(dev); + pci_set_master(dev); + } pci_enable_bridges(dev->subordinate); } }