Skip to content

Commit

Permalink
PCI: do not enable bridges more than once
Browse files Browse the repository at this point in the history
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 <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Alex Chiang authored and Jesse Barnes committed Mar 20, 2009
1 parent b73e97d commit 9dd90ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/pci/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 9dd90ca

Please sign in to comment.