All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Force to clear ASPM bits if CONFIG_PCIEASPM_PERFORMANCE is set
@ 2016-11-02  9:26 Koehrer Mathias (ETAS/ESW5)
  2016-12-08 22:20 ` Bjorn Helgaas
  0 siblings, 1 reply; 9+ messages in thread
From: Koehrer Mathias (ETAS/ESW5) @ 2016-11-02  9:26 UTC (permalink / raw)
  To: linux-pci, Bjorn Helgaas, Bjorn Helgaas
  Cc: Matthew Garrett, Julia Cartwright, Sebastian Andrzej Siewior

On systems that have PCIe ASPM support in the BIOS enabled
the commit 387d37577fdd05e9472c20885464c2a53b3c945f may lead
to the situation that accesses to registers of enabled
PCIe devices are extremely slow.
This happens if the ACPI FADT declares incorrectly that the
system doesn't support PCIe ASPM even if this is enabled in
the BIOS.
In this case the function pcie_no_aspm() will be called.
However this sets the aspm_policy to POLICY_DEFAULT even
if CONFIG_PCIEASPM_PERFORMANCE has been configured.
As result, the ASPM on a PCIe may still be set even if=20
this is not expected.

This happens e.g. on a HP workstation 800 G1 together with
an Intel dual port Ethernet server adapter i350 plugged in.
Whenever ASPM is enabled in the BIOS the access to the=20
LAN registers are really slow (read access: slower than 20us).
In this setup the LnkCap of the two LAN controllers and
of the integrated PCIe switch is set to "ASPM L1 Enabled"=20
even if the controller is configured to be up and running.
There has been a lengthy discussion on this performance issue
due to this issue on the linux-rt-users list:
http://marc.info/?l=3Dlinux-rt-users&m=3D147454824515022&w=3D2


This patch solves this issue by forcing to disable ASPM
if CONFIG_PCIEASPM_PERFORMANCE has been set.

Signed-off-by: Mathias Koehrer <mathias.koehrer@etas.com>

---
 drivers/pci/pcie/aspm.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-4.8/drivers/pci/pcie/aspm.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-4.8.orig/drivers/pci/pcie/aspm.c
+++ linux-4.8/drivers/pci/pcie/aspm.c
@@ -79,10 +79,13 @@ static LIST_HEAD(link_list);
=20
 #ifdef CONFIG_PCIEASPM_PERFORMANCE
 static int aspm_policy =3D POLICY_PERFORMANCE;
+static int aspm_default_config_policy =3D POLICY_PERFORMANCE;
 #elif defined CONFIG_PCIEASPM_POWERSAVE
 static int aspm_policy =3D POLICY_POWERSAVE;
+static int aspm_default_config_policy =3D POLICY_POWERSAFE;
 #else
 static int aspm_policy;
+static int aspm_default_config_policy;
 #endif
=20
 static const char *policy_str[] =3D {
@@ -946,7 +949,7 @@ void pcie_no_aspm(void)
 	 * (b) prevent userspace from changing policy
 	 */
 	if (!aspm_force) {
-		aspm_policy =3D POLICY_DEFAULT;
+		aspm_policy =3D aspm_default_config_policy;
 		aspm_disabled =3D 1;
 	}
 }

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-27 16:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-02  9:26 [PATCH] Force to clear ASPM bits if CONFIG_PCIEASPM_PERFORMANCE is set Koehrer Mathias (ETAS/ESW5)
2016-12-08 22:20 ` Bjorn Helgaas
2016-12-09  9:57   ` Koehrer Mathias (ETAS/ESW5)
2017-01-12 20:54     ` Bjorn Helgaas
2017-01-12 21:48       ` Matthew Garrett
2017-01-12 23:17         ` Bjorn Helgaas
2017-01-13  0:00           ` Matthew Garrett
2017-01-27 16:09           ` Bjorn Helgaas
2017-01-13  8:48       ` Koehrer Mathias (ETAS/ESW5)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.