Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

r8169: check ALDPS bit and disable it if enabled for the 8168g

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>
Acked-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Chang and committed by
David S. Miller
1bac1072 db31c55a

+5
+5
drivers/net/ethernet/realtek/r8169.c
··· 3465 3465 rtl_writephy(tp, 0x14, 0x9065); 3466 3466 rtl_writephy(tp, 0x14, 0x1065); 3467 3467 3468 + /* Check ALDPS bit, disable it if enabled */ 3469 + rtl_writephy(tp, 0x1f, 0x0a43); 3470 + if (rtl_readphy(tp, 0x10) & 0x0004) 3471 + rtl_w1w0_phy(tp, 0x10, 0x0000, 0x0004); 3472 + 3468 3473 rtl_writephy(tp, 0x1f, 0x0000); 3469 3474 } 3470 3475