aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2009-02-17 00:13:20 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-03-20 13:48:00 -0400
commit267efd7eec5eca62f32f8c9bc1721b578d5da963 (patch)
tree3bae75d213470f6b56341b1a6328650299b5784b /drivers/pci/hotplug
parentd18690af626b83fef1d1953b9f70e09497060586 (diff)
PCI hotplug: fix wrong assumption in acpi_get_hp_params_from_firmware
Current acpi_get_hp_params_from_firmware() has a assumption that pci_bus->self is NULL on the root pci bus. But it might not true on some platforms. Because of this wrong assumption, current acpi_get_hp_params_from_firmware() might cause endless loop. We must check pci_bus->parent instead. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/acpi_pcihp.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c
index f47bc74be567..09a84402986d 100644
--- a/drivers/pci/hotplug/acpi_pcihp.c
+++ b/drivers/pci/hotplug/acpi_pcihp.c
@@ -332,19 +332,14 @@ acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus,
332{ 332{
333 acpi_status status = AE_NOT_FOUND; 333 acpi_status status = AE_NOT_FOUND;
334 acpi_handle handle, phandle; 334 acpi_handle handle, phandle;
335 struct pci_bus *pbus = bus; 335 struct pci_bus *pbus;
336 struct pci_dev *pdev;
337 336
338 do { 337 handle = NULL;
339 pdev = pbus->self; 338 for (pbus = bus; pbus; pbus = pbus->parent) {
340 if (!pdev) { 339 handle = acpi_pci_get_bridge_handle(pbus);
341 handle = acpi_get_pci_rootbridge_handle( 340 if (handle)
342 pci_domain_nr(pbus), pbus->number);
343 break; 341 break;
344 } 342 }
345 handle = DEVICE_ACPI_HANDLE(&(pdev->dev));
346 pbus = pbus->parent;
347 } while (!handle);
348 343
349 /* 344 /*
350 * _HPP settings apply to all child buses, until another _HPP is 345 * _HPP settings apply to all child buses, until another _HPP is