Skip to content

Commit 05212ba

Browse files
azatdavem330
authored andcommitted
r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices
I have two Ethernet adapters: r8169 0000:03:01.0 eth0: RTL8169sb/8110sb, 00:14:d1:14:2d:49, XID 10000000, IRQ 18 r8169 0000:01:00.0 eth0: RTL8168e/8111e, 64:66:b3:11:14:5d, XID 2c200000, IRQ 30 And after upgrading from linux 4.15 [1] to linux 4.18+ [2] RTL8169sb failed to receive any packets. tcpdump shows a lot of checksum mismatch. [1]: a0f7938 [2]: 0519359 (4.19 merge window opened) I started bisecting and the found that [3] breaks it. According to [4]: "For 8110S, 8110SB, and 8110SC series, the initial value of RxConfig needs to be set after the tx/rx is enabled." So I moved rtl_init_rxcfg() after enabling tx/rs and now my adapter works (RTL8168e works too). [3]: 3559d81 [4]: e542a22 ("r8169: adjust the RxConfig settings.") Also drop "rx" from rtl_set_rx_tx_config_registers(), since it does nothing with it already. Fixes: 3559d81 ("r8169: simplify rtl_hw_start_8169") Cc: Heiner Kallweit <[email protected]> Cc: David S. Miller <[email protected]> Cc: [email protected] Cc: Realtek linux nic maintainers <[email protected]> Signed-off-by: Azat Khuzhin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9a07efa commit 05212ba

File tree

1 file changed

+4
-2
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+4
-2
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4522,7 +4522,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
45224522
rtl_hw_reset(tp);
45234523
}
45244524

4525-
static void rtl_set_rx_tx_config_registers(struct rtl8169_private *tp)
4525+
static void rtl_set_tx_config_registers(struct rtl8169_private *tp)
45264526
{
45274527
/* Set DMA burst size and Interframe Gap Time */
45284528
RTL_W32(tp, TxConfig, (TX_DMA_BURST << TxDMAShift) |
@@ -4633,12 +4633,14 @@ static void rtl_hw_start(struct rtl8169_private *tp)
46334633

46344634
rtl_set_rx_max_size(tp);
46354635
rtl_set_rx_tx_desc_registers(tp);
4636-
rtl_set_rx_tx_config_registers(tp);
4636+
rtl_set_tx_config_registers(tp);
46374637
RTL_W8(tp, Cfg9346, Cfg9346_Lock);
46384638

46394639
/* Initially a 10 us delay. Turned it into a PCI commit. - FR */
46404640
RTL_R8(tp, IntrMask);
46414641
RTL_W8(tp, ChipCmd, CmdTxEnb | CmdRxEnb);
4642+
rtl_init_rxcfg(tp);
4643+
46424644
rtl_set_rx_mode(tp->dev);
46434645
/* no early-rx interrupts */
46444646
RTL_W16(tp, MultiIntr, RTL_R16(tp, MultiIntr) & 0xf000);

0 commit comments

Comments
 (0)