Skip to contentSkip to conversation

PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

PATCH Applied Rafael J. Wysocki 4 participants 13 messages Mar 5, 2011 – Mar 21, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

From: Rafael J. Wysocki <[email protected]>

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.

References: https://bugzilla.kernel.org/show_bug.cgi?id=29722
References: https://bugzilla.kernel.org/show_bug.cgi?id=20232

---
 drivers/acpi/pci_root.c |    2 +-
 drivers/pci/pcie/aspm.c |    7 +++++++
 include/linux/pci.h     |    7 +++----
 3 files changed, 11 insertions(+), 5 deletions(-)
drivers/pci/pcie/aspm.c +7 -0
Index: linux-2.6/drivers/pci/pcie/aspm.c
===================================================================
@@ -69,6 +69,7 @@ struct pcie_link_state {
 };
 
 static int aspm_disabled, aspm_force, aspm_clear_state;
+static bool aspm_support_enabled = true;
 static DEFINE_MUTEX(aspm_lock);
 static LIST_HEAD(link_list);
 
@@ -896,6 +897,7 @@ static int __init pcie_aspm_disable(char
 {
 	if (!strcmp(str, "off")) {
 		aspm_disabled = 1;
+		aspm_support_enabled = false;
 		printk(KERN_INFO "PCIe ASPM is disabled\n");
 	} else if (!strcmp(str, "force")) {
 		aspm_force = 1;
@@ -930,3 +932,8 @@ int pcie_aspm_enabled(void)
 }
 EXPORT_SYMBOL(pcie_aspm_enabled);
 
+bool pcie_aspm_support_enabled(void)
+{
+	return aspm_support_enabled;
+}
+EXPORT_SYMBOL(pcie_aspm_support_enabled);
drivers/acpi/pci_root.c +1 -1
Index: linux-2.6/drivers/acpi/pci_root.c
===================================================================
@@ -564,7 +564,7 @@ static int __devinit acpi_pci_root_add(s
 	/* Indicate support for various _OSC capabilities. */
 	if (pci_ext_cfg_avail(root->bus->self))
 		flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
-	if (pcie_aspm_enabled())
+	if (pcie_aspm_support_enabled())
 		flags |= OSC_ACTIVE_STATE_PWR_SUPPORT |
 			OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
 	if (pci_msi_enabled())
include/linux/pci.h +3 -4
Index: linux-2.6/include/linux/pci.h
===================================================================
@@ -1002,12 +1002,11 @@ extern bool pcie_ports_auto;
 #endif
 
 #ifndef CONFIG_PCIEASPM
-static inline int pcie_aspm_enabled(void)
-{
-	return 0;
-}
+static inline int pcie_aspm_enabled(void) { return 0; }
+static inline bool pcie_aspm_support_enabled(void) { return false; }
 #else
 extern int pcie_aspm_enabled(void);
+extern bool pcie_aspm_support_enabled(void);
 #endif
 
 #ifdef CONFIG_PCIEAER
Reviewed-by Tested-by on v1 1/1
#1 lore raw

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Regards,
Kenji Kaneshige

Quoted 85 lines · Rafael J. Wysocki

From: Rafael J. Wysocki<[email protected]>

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.

References: https://bugzilla.kernel.org/show_bug.cgi?id=29722
References: https://bugzilla.kernel.org/show_bug.cgi?id=20232

---
  drivers/acpi/pci_root.c |    2 +-
  drivers/pci/pcie/aspm.c |    7 +++++++
  include/linux/pci.h     |    7 +++----
  3 files changed, 11 insertions(+), 5 deletions(-)

Index: linux-2.6/drivers/pci/pcie/aspm.c
===================================================================

drivers/pci/pcie/aspm.c +7 -0
@@ -69,6 +69,7 @@ struct pcie_link_state {
  };
 
  static int aspm_disabled, aspm_force, aspm_clear_state;
+static bool aspm_support_enabled = true;
  static DEFINE_MUTEX(aspm_lock);
  static LIST_HEAD(link_list);
 
@@ -896,6 +897,7 @@ static int __init pcie_aspm_disable(char
  {
  	if (!strcmp(str, "off")) {
  		aspm_disabled = 1;
+		aspm_support_enabled = false;
  		printk(KERN_INFO "PCIe ASPM is disabled\n");
  	} else if (!strcmp(str, "force")) {
  		aspm_force = 1;
@@ -930,3 +932,8 @@ int pcie_aspm_enabled(void)
  }
  EXPORT_SYMBOL(pcie_aspm_enabled);
 
+bool pcie_aspm_support_enabled(void)
+{
+	return aspm_support_enabled;
+}
+EXPORT_SYMBOL(pcie_aspm_support_enabled);

Index: linux-2.6/drivers/acpi/pci_root.c
===================================================================

drivers/acpi/pci_root.c +1 -1
@@ -564,7 +564,7 @@ static int __devinit acpi_pci_root_add(s
  	/* Indicate support for various _OSC capabilities. */
  	if (pci_ext_cfg_avail(root->bus->self))
  		flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
-	if (pcie_aspm_enabled())
+	if (pcie_aspm_support_enabled())
  		flags |= OSC_ACTIVE_STATE_PWR_SUPPORT |
  			OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
  	if (pci_msi_enabled())

Index: linux-2.6/include/linux/pci.h
===================================================================

include/linux/pci.h +3 -5
@@ -1002,12 +1002,11 @@ extern bool pcie_ports_auto;
  #endif
 
  #ifndef CONFIG_PCIEASPM
-static inline int pcie_aspm_enabled(void)
-{
-	return 0;
-}
+static inline int pcie_aspm_enabled(void) { return 0; }
+static inline bool pcie_aspm_support_enabled(void) { return false; }
  #else
  extern int pcie_aspm_enabled(void);
+extern bool pcie_aspm_support_enabled(void);
  #endif
 
  #ifdef CONFIG_PCIEAER
--
Quoted 5 lines

To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

_______________________________________________
linux-pm mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

Reviewed-by Tested-by on v1 1/1
#2 lore raw
In reply to Rafael J. Wysocki

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Regards,
Kenji Kaneshige

Quoted 90 lines · Rafael J. Wysocki

From: Rafael J. Wysocki<[email protected]>

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.

References: https://bugzilla.kernel.org/show_bug.cgi?id=29722
References: https://bugzilla.kernel.org/show_bug.cgi?id=20232

---
  drivers/acpi/pci_root.c |    2 +-
  drivers/pci/pcie/aspm.c |    7 +++++++
  include/linux/pci.h     |    7 +++----
  3 files changed, 11 insertions(+), 5 deletions(-)

Index: linux-2.6/drivers/pci/pcie/aspm.c
===================================================================

drivers/pci/pcie/aspm.c +7 -0
@@ -69,6 +69,7 @@ struct pcie_link_state {
  };
 
  static int aspm_disabled, aspm_force, aspm_clear_state;
+static bool aspm_support_enabled = true;
  static DEFINE_MUTEX(aspm_lock);
  static LIST_HEAD(link_list);
 
@@ -896,6 +897,7 @@ static int __init pcie_aspm_disable(char
  {
  	if (!strcmp(str, "off")) {
  		aspm_disabled = 1;
+		aspm_support_enabled = false;
  		printk(KERN_INFO "PCIe ASPM is disabled\n");
  	} else if (!strcmp(str, "force")) {
  		aspm_force = 1;
@@ -930,3 +932,8 @@ int pcie_aspm_enabled(void)
  }
  EXPORT_SYMBOL(pcie_aspm_enabled);
 
+bool pcie_aspm_support_enabled(void)
+{
+	return aspm_support_enabled;
+}
+EXPORT_SYMBOL(pcie_aspm_support_enabled);

Index: linux-2.6/drivers/acpi/pci_root.c
===================================================================

drivers/acpi/pci_root.c +1 -1
@@ -564,7 +564,7 @@ static int __devinit acpi_pci_root_add(s
  	/* Indicate support for various _OSC capabilities. */
  	if (pci_ext_cfg_avail(root->bus->self))
  		flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
-	if (pcie_aspm_enabled())
+	if (pcie_aspm_support_enabled())
  		flags |= OSC_ACTIVE_STATE_PWR_SUPPORT |
  			OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
  	if (pci_msi_enabled())

Index: linux-2.6/include/linux/pci.h
===================================================================

include/linux/pci.h +3 -5
@@ -1002,12 +1002,11 @@ extern bool pcie_ports_auto;
  #endif
 
  #ifndef CONFIG_PCIEASPM
-static inline int pcie_aspm_enabled(void)
-{
-	return 0;
-}
+static inline int pcie_aspm_enabled(void) { return 0; }
+static inline bool pcie_aspm_support_enabled(void) { return false; }
  #else
  extern int pcie_aspm_enabled(void);
+extern bool pcie_aspm_support_enabled(void);
  #endif
 
  #ifdef CONFIG_PCIEAER
--

To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 8 lines · Kenji Kaneshige

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Yes, I think we need to look at -stable for this one.

Signature · 5 lines
Matthew Garrett | [email protected]
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/linux-pm
#5 lore raw
Quoted 11 lines · On Fri, 18 Mar 2011 01:25:56 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 8 lines · Kenji Kaneshige

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Yes, I think we need to look at -stable for this one.

Ok, thanks guys. I'll queue it up in -fixes and send it to Linus after my 2.6.39 pull req with a cc for stable.

Jesse
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

#6 lore raw
In reply to Matthew Garrett
Quoted 11 lines · On Fri, 18 Mar 2011 01:25:56 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 8 lines · Kenji Kaneshige

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Yes, I think we need to look at -stable for this one.

Ok, thanks guys. I'll queue it up in -fixes and send it to Linus after my 2.6.39 pull req with a cc for stable.

Jesse

#7 lore raw
Quoted 10 lines · Jesse Barnes
Quoted 7 lines · On Fri, 18 Mar 2011 01:25:56 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 6 lines · Kenji Kaneshige

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Yes, I think we need to look at -stable for this one.

Ok, thanks guys. I'll queue it up in -fixes and send it to Linus after my 2.6.39 pull req with a cc for stable.

Well, I thought you could simply include it into the pull request. :-)

Thanks,
Rafael

#8 lore raw
Quoted 14 lines · On Fri, 18 Mar 2011 18:41:28 +0100 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 13 lines · Jesse Barnes
Quoted 10 lines · On Fri, 18 Mar 2011 01:25:56 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 8 lines · Kenji Kaneshige

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Yes, I think we need to look at -stable for this one.

Ok, thanks guys. I'll queue it up in -fixes and send it to Linus after my 2.6.39 pull req with a cc for stable.

Well, I thought you could simply include it into the pull request. :-)

I could have if I had applied it last week...

Signature · 5 lines
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/linux-pm
#9 lore raw
In reply to Rafael J. Wysocki
Quoted 14 lines · On Fri, 18 Mar 2011 18:41:28 +0100 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 13 lines · Jesse Barnes
Quoted 10 lines · On Fri, 18 Mar 2011 01:25:56 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 8 lines · Kenji Kaneshige

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Yes, I think we need to look at -stable for this one.

Ok, thanks guys. I'll queue it up in -fixes and send it to Linus after my 2.6.39 pull req with a cc for stable.

Well, I thought you could simply include it into the pull request. :-)

I could have if I had applied it last week...

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Applied
#10 lore raw
In reply to Rafael J. Wysocki
Quoted 14 lines · On Fri, 18 Mar 2011 18:41:28 +0100 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 13 lines · Jesse Barnes
Quoted 10 lines · On Fri, 18 Mar 2011 01:25:56 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 8 lines · Kenji Kaneshige

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Yes, I think we need to look at -stable for this one.

Ok, thanks guys. I'll queue it up in -fixes and send it to Linus after my 2.6.39 pull req with a cc for stable.

Well, I thought you could simply include it into the pull request. :-)

Applied, I'll send it to Linus this week.

Thanks,

Signature · 5 lines
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/linux-pm
Applied
#11 lore raw
In reply to Rafael J. Wysocki
Quoted 14 lines · On Fri, 18 Mar 2011 18:41:28 +0100 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 13 lines · Jesse Barnes
Quoted 10 lines · On Fri, 18 Mar 2011 01:25:56 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 8 lines · Kenji Kaneshige

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Yes, I think we need to look at -stable for this one.

Ok, thanks guys. I'll queue it up in -fixes and send it to Linus after my 2.6.39 pull req with a cc for stable.

Well, I thought you could simply include it into the pull request. :-)

Applied, I'll send it to Linus this week.

Thanks,

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#12 lore raw
In reply to Jesse Barnes
Quoted 10 lines · Jesse Barnes
Quoted 7 lines · On Fri, 18 Mar 2011 01:25:56 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 6 lines · Kenji Kaneshige

Jesse,

This patch fixes the problem that PCIe hotplug no longer work in 2.6.38 on my platform (ASPM is disabled through ACPI FADT in my platform). I think this need to be applied soon.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Yes, I think we need to look at -stable for this one.

Ok, thanks guys. I'll queue it up in -fixes and send it to Linus after my 2.6.39 pull req with a cc for stable.

Well, I thought you could simply include it into the pull request. :-)

Thanks,
Rafael
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/linux-pm