PCI/ACPI: Report ASPM support to BIOS if not disabled from command line
We need to distinguish the situation in which ASPM support is disabled from the command line or through .config from the situation in which it is disabled, because the hardware or BIOS can't handle it. In the former case we should not report ASPM support to the BIOS through ACPI _OSC, but in the latter case we should do that. Introduce pcie_aspm_support_enabled() that can be used by acpi_pci_root_add() to determine whether or not it should report ASPM support to the BIOS through _OSC. Cc: stable@kernel.org References: https://bugzilla.kernel.org/show_bug.cgi?id=29722 References: https://bugzilla.kernel.org/show_bug.cgi?id=20232 Reported-and-tested-by: Ortwin Glück <odi@odi.ch> Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Tested-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
parent
a44f99c7ef
commit
8b8bae901c
3 changed files with 11 additions and 5 deletions
|
@ -564,7 +564,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
|
||||||
/* Indicate support for various _OSC capabilities. */
|
/* Indicate support for various _OSC capabilities. */
|
||||||
if (pci_ext_cfg_avail(root->bus->self))
|
if (pci_ext_cfg_avail(root->bus->self))
|
||||||
flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
|
flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
|
||||||
if (pcie_aspm_enabled())
|
if (pcie_aspm_support_enabled())
|
||||||
flags |= OSC_ACTIVE_STATE_PWR_SUPPORT |
|
flags |= OSC_ACTIVE_STATE_PWR_SUPPORT |
|
||||||
OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
|
OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
|
||||||
if (pci_msi_enabled())
|
if (pci_msi_enabled())
|
||||||
|
|
|
@ -69,6 +69,7 @@ struct pcie_link_state {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int aspm_disabled, aspm_force, aspm_clear_state;
|
static int aspm_disabled, aspm_force, aspm_clear_state;
|
||||||
|
static bool aspm_support_enabled = true;
|
||||||
static DEFINE_MUTEX(aspm_lock);
|
static DEFINE_MUTEX(aspm_lock);
|
||||||
static LIST_HEAD(link_list);
|
static LIST_HEAD(link_list);
|
||||||
|
|
||||||
|
@ -896,6 +897,7 @@ static int __init pcie_aspm_disable(char *str)
|
||||||
{
|
{
|
||||||
if (!strcmp(str, "off")) {
|
if (!strcmp(str, "off")) {
|
||||||
aspm_disabled = 1;
|
aspm_disabled = 1;
|
||||||
|
aspm_support_enabled = false;
|
||||||
printk(KERN_INFO "PCIe ASPM is disabled\n");
|
printk(KERN_INFO "PCIe ASPM is disabled\n");
|
||||||
} else if (!strcmp(str, "force")) {
|
} else if (!strcmp(str, "force")) {
|
||||||
aspm_force = 1;
|
aspm_force = 1;
|
||||||
|
@ -930,3 +932,8 @@ int pcie_aspm_enabled(void)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(pcie_aspm_enabled);
|
EXPORT_SYMBOL(pcie_aspm_enabled);
|
||||||
|
|
||||||
|
bool pcie_aspm_support_enabled(void)
|
||||||
|
{
|
||||||
|
return aspm_support_enabled;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(pcie_aspm_support_enabled);
|
||||||
|
|
|
@ -1002,12 +1002,11 @@ extern bool pcie_ports_auto;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_PCIEASPM
|
#ifndef CONFIG_PCIEASPM
|
||||||
static inline int pcie_aspm_enabled(void)
|
static inline int pcie_aspm_enabled(void) { return 0; }
|
||||||
{
|
static inline bool pcie_aspm_support_enabled(void) { return false; }
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
extern int pcie_aspm_enabled(void);
|
extern int pcie_aspm_enabled(void);
|
||||||
|
extern bool pcie_aspm_support_enabled(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_PCIEAER
|
#ifdef CONFIG_PCIEAER
|
||||||
|
|
Loading…
Reference in a new issue