linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] r8169: only disable ASPM L1.1 support, instead of disabling them all
@ 2020-03-18  1:45 AceLan Kao
  2020-03-18 11:09 ` Heiner Kallweit
  0 siblings, 1 reply; 3+ messages in thread
From: AceLan Kao @ 2020-03-18  1:45 UTC (permalink / raw)
  To: Realtek linux nic maintainers, Heiner Kallweit, David S. Miller,
	netdev, linux-kernel

The issues which have been seen by enabling ASPM support are from the
BIOS that enables the ASPM L1.1 support on the device. It leads to some
strange behaviors when the device enter L1.1 state.
So, we don't have to disable ASPM support entriely, just disable L1.1
state, that fixes the issues and also has good power management.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index a2168a14794c..b52680e7323b 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5473,11 +5473,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (rc)
 		return rc;
 
-	/* Disable ASPM completely as that cause random device stop working
-	 * problems as well as full system hangs for some PCIe devices users.
+	/* r8169 suppots ASPM L0 and L1 well, and doesn't support L1.1,
+	 * so disable ASPM L1.1 only.
 	 */
-	rc = pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
-					  PCIE_LINK_STATE_L1);
+	rc = pci_disable_link_state(pdev, PCIE_LINK_STATE_L1_1);
 	tp->aspm_manageable = !rc;
 
 	/* enable device (incl. PCI PM wakeup and hotplug setup) */
-- 
2.17.1


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

* Re: [PATCH] r8169: only disable ASPM L1.1 support, instead of disabling them all
  2020-03-18  1:45 [PATCH] r8169: only disable ASPM L1.1 support, instead of disabling them all AceLan Kao
@ 2020-03-18 11:09 ` Heiner Kallweit
  2020-03-22  3:20   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2020-03-18 11:09 UTC (permalink / raw)
  To: AceLan Kao, Realtek linux nic maintainers, David S. Miller,
	netdev, linux-kernel

On 18.03.2020 02:45, AceLan Kao wrote:
> The issues which have been seen by enabling ASPM support are from the
> BIOS that enables the ASPM L1.1 support on the device. It leads to some
> strange behaviors when the device enter L1.1 state.
> So, we don't have to disable ASPM support entriely, just disable L1.1
> state, that fixes the issues and also has good power management.
> 

Meanwhile you can use sysfs to re-enable selected ASPM states, see
entries in "link" directory under the PCI device (provided that BIOS
allows OS to control ASPM). This allows users with mobile devices
w/o the ASPM issue to benefit from the ASPM power savings.

There are ~ 50 RTL8168 chip versions, used on different platforms and
dozens of consumer mainboards (with more or less buggy BIOS versions).
This leaves a good chance that some users may face issues with L0s/L1
enabled. And unfortunately the symptoms of ASPM issues haven't always
been obvious, sometimes just the performance was reduced.
Having said that I'd prefer to keep ASPM an opt-in feature.

Heiner

> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
> ---
>  drivers/net/ethernet/realtek/r8169_main.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> index a2168a14794c..b52680e7323b 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -5473,11 +5473,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (rc)
>  		return rc;
>  
> -	/* Disable ASPM completely as that cause random device stop working
> -	 * problems as well as full system hangs for some PCIe devices users.
> +	/* r8169 suppots ASPM L0 and L1 well, and doesn't support L1.1,
> +	 * so disable ASPM L1.1 only.
>  	 */
> -	rc = pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
> -					  PCIE_LINK_STATE_L1);
> +	rc = pci_disable_link_state(pdev, PCIE_LINK_STATE_L1_1);
>  	tp->aspm_manageable = !rc;
>  
>  	/* enable device (incl. PCI PM wakeup and hotplug setup) */
> 


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

* Re: [PATCH] r8169: only disable ASPM L1.1 support, instead of disabling them all
  2020-03-18 11:09 ` Heiner Kallweit
@ 2020-03-22  3:20   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2020-03-22  3:20 UTC (permalink / raw)
  To: hkallweit1; +Cc: acelan.kao, nic_swsd, netdev, linux-kernel

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Wed, 18 Mar 2020 12:09:14 +0100

> Having said that I'd prefer to keep ASPM an opt-in feature.

Agreed, too much stuff broke randomly and in hard to detect ways.

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

end of thread, other threads:[~2020-03-22  3:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18  1:45 [PATCH] r8169: only disable ASPM L1.1 support, instead of disabling them all AceLan Kao
2020-03-18 11:09 ` Heiner Kallweit
2020-03-22  3:20   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).