netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] r8169: Align ASPM/CLKREQ setting function with vendor driver
@ 2018-09-12  6:58 Kai-Heng Feng
  2018-09-12  6:58 ` [PATCH 2/2] r8169: enable ASPM on RTL8106E Kai-Heng Feng
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kai-Heng Feng @ 2018-09-12  6:58 UTC (permalink / raw)
  To: nic_swsd; +Cc: davem, hkallweit1, netdev, linux-kernel, Kai-Heng Feng

There's a small delay after setting ASPM in vendor drivers, r8101 and
r8168.
In addition, those drivers enable ASPM before ClkReq, also change that
to align with vendor driver.

I haven't seen anything bad becasue of this, but I think it's better to
keep in sync with vendor driver.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/net/ethernet/realtek/r8169.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index b08d51bf7a20..5091e9fd601f 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4775,12 +4775,14 @@ static void rtl_pcie_state_l2l3_enable(struct rtl8169_private *tp, bool enable)
 static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable)
 {
 	if (enable) {
-		RTL_W8(tp, Config2, RTL_R8(tp, Config2) | ClkReqEn);
 		RTL_W8(tp, Config5, RTL_R8(tp, Config5) | ASPM_en);
+		RTL_W8(tp, Config2, RTL_R8(tp, Config2) | ClkReqEn);
 	} else {
 		RTL_W8(tp, Config2, RTL_R8(tp, Config2) & ~ClkReqEn);
 		RTL_W8(tp, Config5, RTL_R8(tp, Config5) & ~ASPM_en);
 	}
+
+	udelay(10);
 }
 
 static void rtl_hw_start_8168bb(struct rtl8169_private *tp)
-- 
2.17.1

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

end of thread, other threads:[~2018-09-18  1:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-12  6:58 [PATCH 1/2] r8169: Align ASPM/CLKREQ setting function with vendor driver Kai-Heng Feng
2018-09-12  6:58 ` [PATCH 2/2] r8169: enable ASPM on RTL8106E Kai-Heng Feng
2018-09-18  1:46   ` David Miller
2018-09-13 17:48 ` [PATCH 1/2] r8169: Align ASPM/CLKREQ setting function with vendor driver David Miller
2018-09-18  1:46 ` 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).