Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Hayes Wang <hayeswang@realtek.com>
To: <hkallweit1@gmail.com>
Cc: <netdev@vger.kernel.org>, <nic_swsd@realtek.com>,
	<koba.ko@canonical.com>, Hayes Wang <hayeswang@realtek.com>
Subject: [PATCH net-next 2/2] r8169: change the L0/L1 entrance latencies for RTL8106e
Date: Fri, 6 Aug 2021 17:15:56 +0800	[thread overview]
Message-ID: <20210806091556.1297186-376-nic_swsd@realtek.com> (raw)
In-Reply-To: <20210806091556.1297186-374-nic_swsd@realtek.com>

The original L0 and L1 entrance latencies of RTL8106e are 4us. And
they cause the delay of link-up interrupt when enabling ASPM. Change
the L0 entrance latency to 7us and L1 entrance latency to 32us. Then,
they could avoid the issue.

Tested-by: Koba Ko <koba.ko@canonical.com>
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index d2647036b1e7..2c643ec36bdf 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -3502,6 +3502,9 @@ static void rtl_hw_start_8106(struct rtl8169_private *tp)
 	RTL_W8(tp, MCU, RTL_R8(tp, MCU) | EN_NDP | EN_OOB_RESET);
 	RTL_W8(tp, DLLPR, RTL_R8(tp, DLLPR) & ~PFM_EN);
 
+	/* The default value is 0x13. Change it to 0x2f */
+	rtl_csi_access_enable(tp, 0x2f);
+
 	rtl_eri_write(tp, 0x1d0, ERIAR_MASK_0011, 0x0000);
 
 	/* disable EEE */
-- 
2.31.1


  parent reply	other threads:[~2021-08-06  9:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06  9:15 [PATCH net-next 0/2] r8169: adjust the setting " Hayes Wang
2021-08-06  9:15 ` [PATCH net-next 1/2] Revert "r8169: avoid link-up interrupt issue on RTL8106e if user enables ASPM" Hayes Wang
2021-08-06  9:15 ` Hayes Wang [this message]
2021-08-06 21:27   ` [PATCH net-next 2/2] r8169: change the L0/L1 entrance latencies for RTL8106e Heiner Kallweit
2021-08-07  3:50     ` Hayes Wang
2021-08-07  8:40 ` [PATCH net-next 0/2] r8169: adjust the setting " patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210806091556.1297186-376-nic_swsd@realtek.com \
    --to=hayeswang@realtek.com \
    --cc=hkallweit1@gmail.com \
    --cc=koba.ko@canonical.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --subject='Re: [PATCH net-next 2/2] r8169: change the L0/L1 entrance latencies for RTL8106e' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).