diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-09-05 17:07:42 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-09-23 19:40:46 -0400 |
commit | b8eb67fcc4548b9f0d00bbfd1c0c8f72d8018900 (patch) | |
tree | 9146dd8b2c6227e5db5c982e51c788224708ef96 /drivers/acpi | |
parent | 3e43abb012d45dc284ef9a0fb0cea0fb004b5607 (diff) |
PCI/ACPI: Split _OSC "support" and "control" flags into separate variables
Previously we used "flags" for both:
- the bitmask of features we support (segments, ASPM, MSI, etc.), and
- the bitmask of features we want to control (native hotplug, AER, etc.)
To reduce confusion, this patch splits this into two variables:
"support" is the bitmask of features we support, and "control" is the
bitmask of features we want to control. No functional change.
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.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 3e57f104e09a..3e06d4e179ec 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -363,7 +363,7 @@ EXPORT_SYMBOL(acpi_pci_osc_control_set); | |||
363 | static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, | 363 | static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, |
364 | int *clear_aspm) | 364 | int *clear_aspm) |
365 | { | 365 | { |
366 | u32 flags, base_flags; | 366 | u32 support, base_support, control; |
367 | acpi_status status; | 367 | acpi_status status; |
368 | struct acpi_device *device = root->device; | 368 | struct acpi_device *device = root->device; |
369 | acpi_handle handle = device->handle; | 369 | acpi_handle handle = device->handle; |
@@ -372,29 +372,29 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, | |||
372 | * All supported architectures that use ACPI have support for | 372 | * All supported architectures that use ACPI have support for |
373 | * PCI domains, so we indicate this in _OSC support capabilities. | 373 | * PCI domains, so we indicate this in _OSC support capabilities. |
374 | */ | 374 | */ |
375 | flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT; | 375 | support = base_support = OSC_PCI_SEGMENT_GROUPS_SUPPORT; |
376 | acpi_pci_osc_support(root, flags); | 376 | acpi_pci_osc_support(root, support); |
377 | 377 | ||
378 | if (pci_ext_cfg_avail()) | 378 | if (pci_ext_cfg_avail()) |
379 | flags |= OSC_PCI_EXT_CONFIG_SUPPORT; | 379 | support |= OSC_PCI_EXT_CONFIG_SUPPORT; |
380 | if (pcie_aspm_support_enabled()) { | 380 | if (pcie_aspm_support_enabled()) { |
381 | flags |= OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT; | 381 | support |= OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT; |
382 | } | 382 | } |
383 | if (pci_msi_enabled()) | 383 | if (pci_msi_enabled()) |
384 | flags |= OSC_PCI_MSI_SUPPORT; | 384 | support |= OSC_PCI_MSI_SUPPORT; |
385 | if (flags != base_flags) { | 385 | if (support != base_support) { |
386 | status = acpi_pci_osc_support(root, flags); | 386 | status = acpi_pci_osc_support(root, support); |
387 | if (ACPI_FAILURE(status)) { | 387 | if (ACPI_FAILURE(status)) { |
388 | dev_info(&device->dev, "ACPI _OSC support " | 388 | dev_info(&device->dev, "ACPI _OSC support " |
389 | "notification failed, disabling PCIe ASPM\n"); | 389 | "notification failed, disabling PCIe ASPM\n"); |
390 | *no_aspm = 1; | 390 | *no_aspm = 1; |
391 | flags = base_flags; | 391 | support = base_support; |
392 | } | 392 | } |
393 | } | 393 | } |
394 | 394 | ||
395 | if (!pcie_ports_disabled | 395 | if (!pcie_ports_disabled |
396 | && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { | 396 | && (support & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { |
397 | flags = OSC_PCI_EXPRESS_CAPABILITY_CONTROL | 397 | control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL |
398 | | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | 398 | | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL |
399 | | OSC_PCI_EXPRESS_PME_CONTROL; | 399 | | OSC_PCI_EXPRESS_PME_CONTROL; |
400 | 400 | ||
@@ -403,17 +403,18 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, | |||
403 | dev_dbg(&device->dev, | 403 | dev_dbg(&device->dev, |
404 | "PCIe errors handled by BIOS.\n"); | 404 | "PCIe errors handled by BIOS.\n"); |
405 | else | 405 | else |
406 | flags |= OSC_PCI_EXPRESS_AER_CONTROL; | 406 | control |= OSC_PCI_EXPRESS_AER_CONTROL; |
407 | } | 407 | } |
408 | 408 | ||
409 | dev_info(&device->dev, | 409 | dev_info(&device->dev, |
410 | "Requesting ACPI _OSC control (0x%02x)\n", flags); | 410 | "Requesting ACPI _OSC control (0x%02x)\n", control); |
411 | 411 | ||
412 | status = acpi_pci_osc_control_set(handle, &flags, | 412 | status = acpi_pci_osc_control_set(handle, &control, |
413 | OSC_PCI_EXPRESS_CAPABILITY_CONTROL); | 413 | OSC_PCI_EXPRESS_CAPABILITY_CONTROL); |
414 | if (ACPI_SUCCESS(status)) { | 414 | if (ACPI_SUCCESS(status)) { |
415 | dev_info(&device->dev, | 415 | dev_info(&device->dev, |
416 | "ACPI _OSC control (0x%02x) granted\n", flags); | 416 | "ACPI _OSC control (0x%02x) granted\n", |
417 | control); | ||
417 | if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) { | 418 | if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) { |
418 | /* | 419 | /* |
419 | * We have ASPM control, but the FADT indicates | 420 | * We have ASPM control, but the FADT indicates |
@@ -425,7 +426,7 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, | |||
425 | dev_info(&device->dev, | 426 | dev_info(&device->dev, |
426 | "ACPI _OSC request failed (%s), " | 427 | "ACPI _OSC request failed (%s), " |
427 | "returned control mask: 0x%02x\n", | 428 | "returned control mask: 0x%02x\n", |
428 | acpi_format_exception(status), flags); | 429 | acpi_format_exception(status), control); |
429 | dev_info(&device->dev, | 430 | dev_info(&device->dev, |
430 | "ACPI _OSC control for PCIe not granted, disabling ASPM\n"); | 431 | "ACPI _OSC control for PCIe not granted, disabling ASPM\n"); |
431 | /* | 432 | /* |
@@ -440,7 +441,7 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, | |||
440 | } else { | 441 | } else { |
441 | dev_info(&device->dev, | 442 | dev_info(&device->dev, |
442 | "Unable to request _OSC control " | 443 | "Unable to request _OSC control " |
443 | "(_OSC support mask: 0x%02x)\n", flags); | 444 | "(_OSC support mask: 0x%02x)\n", support); |
444 | } | 445 | } |
445 | } | 446 | } |
446 | 447 | ||