netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] r8169: check ALDPS bit and disable it if enabled for the 8168g
@ 2013-11-27  7:48 David Chang
  2013-11-28  0:02 ` Francois Romieu
  2013-11-28  3:37 ` [PATCH net] r8169: check ALDPS bit and disable it if enabled for the 8168g hayeswang
  0 siblings, 2 replies; 9+ messages in thread
From: David Chang @ 2013-11-27  7:48 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Francois Romieu, Hayes Wang, jlee


Windows driver will enable ALDPS function, but linux driver and firmware
do not have any configuration related to ALDPS function for 8168g.
So restart system to linux and remove the NIC cable, LAN enter ALDPS,
then LAN RX will be disabled.

This issue can be easily reproduced on dual boot windows and linux
system with RTL_GIGA_MAC_VER_40 chip.

Realtek said, ALDPS function can be disabled by configuring to PHY,
switch to page 0x0A43, reg0x10 bit2=0.

Signed-off-by: David Chang <dchang@suse.com>
---
 drivers/net/ethernet/realtek/r8169.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 7993875..c737f0e 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3465,6 +3465,11 @@ static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x14, 0x9065);
 	rtl_writephy(tp, 0x14, 0x1065);
 
+	/* Check ALDPS bit, disable it if enabled */
+	rtl_writephy(tp, 0x1f, 0x0a43);
+	if (rtl_readphy(tp, 0x10) & 0x0004)
+		rtl_w1w0_phy(tp, 0x10, 0x0000, 0x0004);
+
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-- 
1.8.1.4

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

end of thread, other threads:[~2013-11-29 21:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27  7:48 [PATCH net] r8169: check ALDPS bit and disable it if enabled for the 8168g David Chang
2013-11-28  0:02 ` Francois Romieu
2013-11-28  3:37   ` [PATCH net] r8169: check ALDPS bit and disable it if enabled forthe 8168g hayeswang
2013-11-28  3:37 ` [PATCH net] r8169: check ALDPS bit and disable it if enabled for the 8168g hayeswang
2013-11-28  4:29   ` David Chang
2013-11-28  5:28     ` [PATCH net] r8169: check ALDPS bit and disable it if enabled forthe 8168g hayeswang
2013-11-28  6:22       ` David Chang
2013-11-28  7:58         ` [PATCH net] r8169: check ALDPS bit and disable it if enabledforthe 8168g hayeswang
2013-11-29 21:17           ` 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).