summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-09-05 17:50:52 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-09-23 19:40:47 -0400
commitde18966228ed4b42393ecbe83ba20ff3db78bfdc (patch)
tree6fc34cf631368284e0528e8e4fb60a0db39a6cf6 /drivers/acpi
parent43613a1fac0eec78de14fecc9de184e1052abac7 (diff)
PCI/ACPI: Separate out _OSC "we don't support enough services" path
Test the services we support (extended config space, ASPM, MSI) separately so we can give a better message. Previously we said "Unable to request _OSC control..."; now we'll say "we support %#02x but %#02x are required". Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/pci_root.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 68e5a187e784..65aefcf78552 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -392,55 +392,55 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
392 return; 392 return;
393 } 393 }
394 394
395 if ((support & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { 395 if ((support & ACPI_PCIE_REQ_SUPPORT) != ACPI_PCIE_REQ_SUPPORT) {
396 control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL 396 dev_info(&device->dev, "Not requesting _OSC control (we support %#02x but %#02x are required)\n",
397 | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 397 support, ACPI_PCIE_REQ_SUPPORT);
398 | OSC_PCI_EXPRESS_PME_CONTROL; 398 return;
399 399 }
400 if (pci_aer_available()) { 400
401 if (aer_acpi_firmware_first()) 401 control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL
402 dev_dbg(&device->dev, 402 | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL
403 "PCIe errors handled by BIOS.\n"); 403 | OSC_PCI_EXPRESS_PME_CONTROL;
404 else 404
405 control |= OSC_PCI_EXPRESS_AER_CONTROL; 405 if (pci_aer_available()) {
406 } 406 if (aer_acpi_firmware_first())
407 dev_dbg(&device->dev,
408 "PCIe errors handled by BIOS.\n");
409 else
410 control |= OSC_PCI_EXPRESS_AER_CONTROL;
411 }
407 412
413 dev_info(&device->dev,
414 "Requesting ACPI _OSC control (0x%02x)\n", control);
415
416 status = acpi_pci_osc_control_set(handle, &control,
417 OSC_PCI_EXPRESS_CAPABILITY_CONTROL);
418 if (ACPI_SUCCESS(status)) {
408 dev_info(&device->dev, 419 dev_info(&device->dev,
409 "Requesting ACPI _OSC control (0x%02x)\n", control); 420 "ACPI _OSC control (0x%02x) granted\n",
410 421 control);
411 status = acpi_pci_osc_control_set(handle, &control, 422 if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
412 OSC_PCI_EXPRESS_CAPABILITY_CONTROL);
413 if (ACPI_SUCCESS(status)) {
414 dev_info(&device->dev,
415 "ACPI _OSC control (0x%02x) granted\n",
416 control);
417 if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
418 /*
419 * We have ASPM control, but the FADT indicates
420 * that it's unsupported. Clear it.
421 */
422 *clear_aspm = 1;
423 }
424 } else {
425 dev_info(&device->dev,
426 "ACPI _OSC request failed (%s), "
427 "returned control mask: 0x%02x\n",
428 acpi_format_exception(status), control);
429 dev_info(&device->dev,
430 "ACPI _OSC control for PCIe not granted, disabling ASPM\n");
431 /* 423 /*
432 * We want to disable ASPM here, but aspm_disabled 424 * We have ASPM control, but the FADT indicates
433 * needs to remain in its state from boot so that we 425 * that it's unsupported. Clear it.
434 * properly handle PCIe 1.1 devices. So we set this
435 * flag here, to defer the action until after the ACPI
436 * root scan.
437 */ 426 */
438 *no_aspm = 1; 427 *clear_aspm = 1;
439 } 428 }
440 } else { 429 } else {
441 dev_info(&device->dev, 430 dev_info(&device->dev,
442 "Unable to request _OSC control " 431 "ACPI _OSC request failed (%s), "
443 "(_OSC support mask: 0x%02x)\n", support); 432 "returned control mask: 0x%02x\n",
433 acpi_format_exception(status), control);
434 dev_info(&device->dev,
435 "ACPI _OSC control for PCIe not granted, disabling ASPM\n");
436 /*
437 * We want to disable ASPM here, but aspm_disabled
438 * needs to remain in its state from boot so that we
439 * properly handle PCIe 1.1 devices. So we set this
440 * flag here, to defer the action until after the ACPI
441 * root scan.
442 */
443 *no_aspm = 1;
444 } 444 }
445} 445}
446 446