diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-05-21 12:56:51 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-05-21 12:56:51 -0400 |
commit | 2add0ec14c259471d45d6afd051ca02eef0a4a92 (patch) | |
tree | f863949b30c8a3e0b3096b1284096a6e675069b7 /drivers/pci/pcie/aspm.c | |
parent | de7f2b1bdf02f6b44410dceb7295284c2a75a304 (diff) |
PCI/ASPM: Warn when driver asks to disable ASPM, but we can't do it
Some devices have hardware problems related to using ASPM. Drivers for
these devices use pci_disable_link_state() to prevent their device from
entering L0s or L1. But on platforms where the OS doesn't have permission
to manage ASPM, pci_disable_link_state() doesn't actually disable ASPM.
Windows has a similar mechanism ("PciASPMOptOut"), and when the OS doesn't
have control of ASPM, it doesn't actually disable ASPM either.
This patch just adds a warning in dmesg about the fact that
pci_disable_link_state() is doing nothing.
Reported-by: Emmanuel Grumbach <egrumbach@gmail.com>
Reference: https://lkml.kernel.org/r/CANUX_P3F5YhbZX3WGU-j1AGpbXb_T9Bis2ErhvKkFMtDvzatVQ@mail.gmail.com
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=57331
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pcie/aspm.c')
-rw-r--r-- | drivers/pci/pcie/aspm.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index d320df6375a2..faa83b632a84 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c | |||
@@ -724,9 +724,6 @@ static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem, | |||
724 | struct pci_dev *parent = pdev->bus->self; | 724 | struct pci_dev *parent = pdev->bus->self; |
725 | struct pcie_link_state *link; | 725 | struct pcie_link_state *link; |
726 | 726 | ||
727 | if (aspm_disabled && !force) | ||
728 | return; | ||
729 | |||
730 | if (!pci_is_pcie(pdev)) | 727 | if (!pci_is_pcie(pdev)) |
731 | return; | 728 | return; |
732 | 729 | ||
@@ -736,6 +733,19 @@ static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem, | |||
736 | if (!parent || !parent->link_state) | 733 | if (!parent || !parent->link_state) |
737 | return; | 734 | return; |
738 | 735 | ||
736 | /* | ||
737 | * A driver requested that ASPM be disabled on this device, but | ||
738 | * if we don't have permission to manage ASPM (e.g., on ACPI | ||
739 | * systems we have to observe the FADT ACPI_FADT_NO_ASPM bit and | ||
740 | * the _OSC method), we can't honor that request. Windows has | ||
741 | * a similar mechanism using "PciASPMOptOut", which is also | ||
742 | * ignored in this situation. | ||
743 | */ | ||
744 | if (aspm_disabled && !force) { | ||
745 | dev_warn(&pdev->dev, "can't disable ASPM; OS doesn't have ASPM control\n"); | ||
746 | return; | ||
747 | } | ||
748 | |||
739 | if (sem) | 749 | if (sem) |
740 | down_read(&pci_bus_sem); | 750 | down_read(&pci_bus_sem); |
741 | mutex_lock(&aspm_lock); | 751 | mutex_lock(&aspm_lock); |