diff options
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r-- | drivers/acpi/pci_root.c | 54 |
1 files changed, 16 insertions, 38 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 196f97d00956..a8b250783937 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -365,12 +365,12 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
365 | { | 365 | { |
366 | int result = 0; | 366 | int result = 0; |
367 | struct acpi_pci_root *root = NULL; | 367 | struct acpi_pci_root *root = NULL; |
368 | struct acpi_pci_root *tmp; | ||
369 | acpi_status status = AE_OK; | 368 | acpi_status status = AE_OK; |
370 | unsigned long long value = 0; | 369 | unsigned long long value = 0; |
371 | acpi_handle handle = NULL; | 370 | acpi_handle handle = NULL; |
372 | struct acpi_device *child; | 371 | struct acpi_device *child; |
373 | u32 flags, base_flags; | 372 | u32 flags, base_flags; |
373 | int bus; | ||
374 | 374 | ||
375 | 375 | ||
376 | if (!device) | 376 | if (!device) |
@@ -420,46 +420,24 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
420 | /* | 420 | /* |
421 | * Bus | 421 | * Bus |
422 | * --- | 422 | * --- |
423 | * Obtained via _BBN, if exists, otherwise assumed to be zero (0). | 423 | * Check _CRS first, then _BBN. If no _BBN, default to zero. |
424 | */ | 424 | */ |
425 | status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, NULL, | 425 | status = try_get_root_bridge_busnr(device->handle, &bus); |
426 | &value); | 426 | if (ACPI_SUCCESS(status)) |
427 | switch (status) { | 427 | root->id.bus = bus; |
428 | case AE_OK: | 428 | else { |
429 | root->id.bus = (u16) value; | 429 | status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, NULL, &value); |
430 | break; | 430 | if (ACPI_SUCCESS(status)) |
431 | case AE_NOT_FOUND: | 431 | root->id.bus = (u16) value; |
432 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Assuming bus 0 (no _BBN)\n")); | 432 | else if (status == AE_NOT_FOUND) |
433 | root->id.bus = 0; | 433 | root->id.bus = 0; |
434 | break; | 434 | else { |
435 | default: | 435 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BBN")); |
436 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BBN")); | 436 | result = -ENODEV; |
437 | result = -ENODEV; | 437 | goto end; |
438 | goto end; | ||
439 | } | ||
440 | |||
441 | /* Some systems have wrong _BBN */ | ||
442 | list_for_each_entry(tmp, &acpi_pci_roots, node) { | ||
443 | if ((tmp->id.segment == root->id.segment) | ||
444 | && (tmp->id.bus == root->id.bus)) { | ||
445 | int bus = 0; | ||
446 | acpi_status status; | ||
447 | |||
448 | printk(KERN_ERR PREFIX | ||
449 | "Wrong _BBN value, reboot" | ||
450 | " and use option 'pci=noacpi'\n"); | ||
451 | |||
452 | status = try_get_root_bridge_busnr(device->handle, &bus); | ||
453 | if (ACPI_FAILURE(status)) | ||
454 | break; | ||
455 | if (bus != root->id.bus) { | ||
456 | printk(KERN_INFO PREFIX | ||
457 | "PCI _CRS %d overrides _BBN 0\n", bus); | ||
458 | root->id.bus = bus; | ||
459 | } | ||
460 | break; | ||
461 | } | 438 | } |
462 | } | 439 | } |
440 | |||
463 | /* | 441 | /* |
464 | * Device & Function | 442 | * Device & Function |
465 | * ----------------- | 443 | * ----------------- |