From db3e1cc3257758d8a694d0a6ab29f109fb019853 Mon Sep 17 00:00:00 2001 From: Li Shaohua Date: Thu, 7 Dec 2006 20:57:05 +0800 Subject: ACPI: Convert ACPI PCI .bind/.unbind to use PCI bridge driver acpi_device had a .bind/.unbind methods, but Linux driver model does not. Cut ACPI PCI code over to use the Linux driver model methods. Convert bind/unbind to use a new pci bridge driver. The driver will add/remove _PRT, so we can eventually remove .bind/.unbind methods. Signed-off-by: Zhang Rui Signed-off-by: Len Brown --- drivers/acpi/pci_root.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/acpi/pci_root.c') diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 0984a1ee24ed..9cfc74192419 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -175,11 +175,6 @@ static int acpi_pci_root_add(struct acpi_device *device) strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); acpi_driver_data(device) = root; - /* - * TBD: Doesn't the bus driver automatically set this? - */ - device->ops.bind = acpi_pci_bind; - /* * Segment * ------- -- cgit v1.2.3 From 2786f6e388e9dfe9e7b1c3c6bd7fcfba9cfb9831 Mon Sep 17 00:00:00 2001 From: Rui Zhang Date: Thu, 21 Dec 2006 02:21:13 -0500 Subject: ACPI: fix Supermicro X7DB8+ Boot regression http://bugzilla.kernel.org/show_bug.cgi?id=7695 Originally we converted bind/unbind to use a new pci bridge driver. The driver will add/remove _PRT, so we can eventually remove .bind/.unbind methods. But we found that some of the _ADR-Based devices don't have _PRT, i.e. they are not managed by the new ACPI PCI bridge driver. So that .bind method is not called for some _ADR-Based devices, which leads to a failure. Now we make ACPI PCI Root Bridge Driver scan and binds all _ADR-Based devices once the driver is loaded, in the .add method of ACPI PCI Root Bridge driver. Extra code path for calling .bind/.unbind when _ADR-Based devices are hot added/removed is also added. Signed-off-by: Zhang Rui Signed-off-by: Len Brown --- drivers/acpi/pci_root.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'drivers/acpi/pci_root.c') diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 9cfc74192419..2e1a74a967bb 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -151,6 +151,21 @@ static acpi_status try_get_root_bridge_busnr(acpi_handle handle, int *busnum) return AE_OK; } +static void acpi_pci_bridge_scan(struct acpi_device *device) +{ + int status; + struct acpi_device *child = NULL; + + if (device->flags.bus_address) + if (device->parent && device->parent->ops.bind) { + status = device->parent->ops.bind(device); + if (!status) { + list_for_each_entry(child, &device->children, node) + acpi_pci_bridge_scan(child); + } + } +} + static int acpi_pci_root_add(struct acpi_device *device) { int result = 0; @@ -159,6 +174,7 @@ static int acpi_pci_root_add(struct acpi_device *device) acpi_status status = AE_OK; unsigned long value = 0; acpi_handle handle = NULL; + struct acpi_device *child; if (!device) @@ -175,6 +191,8 @@ static int acpi_pci_root_add(struct acpi_device *device) strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); acpi_driver_data(device) = root; + device->ops.bind = acpi_pci_bind; + /* * Segment * ------- @@ -294,6 +312,12 @@ static int acpi_pci_root_add(struct acpi_device *device) result = acpi_pci_irq_add_prt(device->handle, root->id.segment, root->id.bus); + /* + * Scan and bind all _ADR-Based Devices + */ + list_for_each_entry(child, &device->children, node) + acpi_pci_bridge_scan(child); + end: if (result) { if (!list_empty(&root->node)) -- cgit v1.2.3