drivers/pci/hotplug/acpiphp_glue.c | 18 ++++++++++++++++++ include/linux/pci-acpi.h | 25 ++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) Index: linux-2.6.29-rc1/include/linux/pci-acpi.h =================================================================== --- linux-2.6.29-rc1.orig/include/linux/pci-acpi.h 2008-12-01 22:59:52.000000000 +0900 +++ linux-2.6.29-rc1/include/linux/pci-acpi.h 2009-01-19 10:27:13.000000000 +0900 @@ -65,9 +65,28 @@ { int seg = pci_domain_nr(pbus), busnr = pbus->number; struct pci_dev *bridge = pbus->self; - if (bridge) - return DEVICE_ACPI_HANDLE(&(bridge->dev)); - return acpi_get_pci_rootbridge_handle(seg, busnr); + acpi_handle handle; + char objname[64] = ""; + struct acpi_buffer buffer = { .length = sizeof(objname), + .pointer = objname }; + + printk(KERN_INFO "%s: bridge(pbus->self) = %p, pbus->parent = %p\n", + __func__, bridge, pbus->parent); + + if (bridge) { + printk(KERN_INFO "%s: handle the bridge as PtoP.\n", __func__); + handle = DEVICE_ACPI_HANDLE(&(bridge->dev)); + } else { + printk(KERN_INFO "%s: handle the bridge as root.\n", __func__); + handle = acpi_get_pci_rootbridge_handle(seg, busnr); + } + + if (handle) + acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); + printk(KERN_INFO "%s: ACPI handle of the bridge for %04x:%02x: %p %s\n", + __func__, seg, busnr, handle, objname); + + return handle; } #else #if !defined(AE_ERROR) Index: linux-2.6.29-rc1/drivers/pci/hotplug/acpiphp_glue.c =================================================================== --- linux-2.6.29-rc1.orig/drivers/pci/hotplug/acpiphp_glue.c 2008-12-01 22:59:46.000000000 +0900 +++ linux-2.6.29-rc1/drivers/pci/hotplug/acpiphp_glue.c 2009-01-19 10:32:05.000000000 +0900 @@ -266,6 +266,12 @@ int found = acpi_pci_detect_ejectable(pbus); if (!found) { acpi_handle bridge_handle = acpi_pci_get_bridge_handle(pbus); + if (!bridge_handle) { + printk(KERN_INFO + "%s: NULL handle returned!!!\n", __func__); + WARN_ON(1); + return 0; + } acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle, (u32)1, is_pci_dock_device, (void *)&found, NULL); } @@ -459,6 +465,9 @@ int device, function; struct pci_dev *dev; struct pci_bus *pci_bus = context; + char objname[64]; + struct acpi_buffer buffer = { .length = sizeof(objname), + .pointer = objname }; status = acpi_get_handle(handle, "_ADR", &dummy_handle); if (ACPI_FAILURE(status)) @@ -478,6 +487,9 @@ if (!dev || !dev->subordinate) goto out; + acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); + printk(KERN_INFO "%s: Detecting slots under PtoP bridge (%s)\n", + __func__, objname); /* check if this bridge has ejectable slots */ if ((detect_ejectable_slots(dev->subordinate) > 0)) { dbg("found PCI-to-PCI bridge at PCI %s\n", pci_name(dev)); @@ -504,6 +516,9 @@ int seg, bus; acpi_handle dummy_handle; struct pci_bus *pci_bus; + char objname[64]; + struct acpi_buffer buffer = { .length = sizeof(objname), + .pointer = objname }; /* if the bridge doesn't have _STA, we assume it is always there */ status = acpi_get_handle(handle, "_STA", &dummy_handle); @@ -539,6 +554,9 @@ return 0; } + acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); + printk(KERN_INFO "%s: Detecting slots under root bridge (%s)\n", + __func__, objname); /* check if this bridge has ejectable slots */ if (detect_ejectable_slots(pci_bus) > 0) { dbg("found PCI host-bus bridge with hot-pluggable slots\n");