diff options
author | Rui Zhang <rui.zhang@intel.com> | 2006-12-21 02:21:13 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-12-21 03:07:37 -0500 |
commit | 2786f6e388e9dfe9e7b1c3c6bd7fcfba9cfb9831 (patch) | |
tree | 76f0bbaf42cc977a3b6944314f4c3043937a8ee7 /drivers/acpi/pci_bind.c | |
parent | e49bd2dd5a503bb94fe2f2af45422b610940b75d (diff) |
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 <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/pci_bind.c')
-rw-r--r-- | drivers/acpi/pci_bind.c | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c index aa05e92464e6..1e2ae6e7a7e4 100644 --- a/drivers/acpi/pci_bind.c +++ b/drivers/acpi/pci_bind.c | |||
@@ -223,6 +223,8 @@ int acpi_pci_bind(struct acpi_device *device) | |||
223 | data->id.segment, data->id.bus, | 223 | data->id.segment, data->id.bus, |
224 | data->id.device, data->id.function)); | 224 | data->id.device, data->id.function)); |
225 | data->bus = data->dev->subordinate; | 225 | data->bus = data->dev->subordinate; |
226 | device->ops.bind = acpi_pci_bind; | ||
227 | device->ops.unbind = acpi_pci_unbind; | ||
226 | } | 228 | } |
227 | 229 | ||
228 | /* | 230 | /* |
@@ -352,6 +354,8 @@ acpi_pci_bind_root(struct acpi_device *device, | |||
352 | 354 | ||
353 | data->id = *id; | 355 | data->id = *id; |
354 | data->bus = bus; | 356 | data->bus = bus; |
357 | device->ops.bind = acpi_pci_bind; | ||
358 | device->ops.unbind = acpi_pci_unbind; | ||
355 | 359 | ||
356 | acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer); | 360 | acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer); |
357 | 361 | ||
@@ -374,39 +378,3 @@ acpi_pci_bind_root(struct acpi_device *device, | |||
374 | 378 | ||
375 | return result; | 379 | return result; |
376 | } | 380 | } |
377 | |||
378 | #define ACPI_PCI_BRIDGE_DRIVER_NAME "ACPI PCI Bridge Driver" | ||
379 | |||
380 | static int acpi_pci_bridge_add(struct acpi_device *device); | ||
381 | static int acpi_pci_bridge_remove(struct acpi_device *device, int type); | ||
382 | |||
383 | static struct acpi_driver acpi_pci_bridge_driver = { | ||
384 | .name = ACPI_PCI_BRIDGE_DRIVER_NAME, | ||
385 | .ids = ACPI_PCI_BRIDGE_HID, | ||
386 | .ops = { | ||
387 | .add = acpi_pci_bridge_add, | ||
388 | .remove = acpi_pci_bridge_remove, | ||
389 | }, | ||
390 | }; | ||
391 | |||
392 | static int acpi_pci_bridge_add(struct acpi_device *device) | ||
393 | { | ||
394 | return acpi_pci_bind(device); | ||
395 | } | ||
396 | |||
397 | static int acpi_pci_bridge_remove(struct acpi_device *device, int type) | ||
398 | { | ||
399 | return acpi_pci_unbind(device); | ||
400 | } | ||
401 | |||
402 | static int __init acpi_pci_bridge_init(void) | ||
403 | { | ||
404 | if (acpi_pci_disabled) | ||
405 | return 0; | ||
406 | if (acpi_bus_register_driver(&acpi_pci_bridge_driver) < 0) | ||
407 | return -ENODEV; | ||
408 | return 0; | ||
409 | } | ||
410 | |||
411 | /* Should be called after ACPI pci root driver */ | ||
412 | subsys_initcall(acpi_pci_bridge_init); | ||