Skip to content

Commit b39fe41

Browse files
author
Francois Romieu
committed
r8169: quirk for the 8110sb on arm platform
Inverting the write ordering of the TxDescAddr{High/Low} registers suffices to trigger a sabbat of PCI errors which make the device completely dysfunctional. The issue has not been reported on a different platform. Switching from MMIO accesses to I/O ones as done in Realtek's own driver fixes (papers over ?) the bug as well but I am not thrilled to see everyone pay the I/O price for an obscure bug. This is the minimal change to handle the issue. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
1 parent d2eed8c commit b39fe41

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/net/r8169.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,10 +1904,15 @@ rtl8169_hw_start(struct net_device *dev)
19041904
*/
19051905
RTL_W16(IntrMitigate, 0x0000);
19061906

1907-
RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK));
1907+
/*
1908+
* Magic spell: some iop3xx ARM board needs the TxDescAddrHigh
1909+
* register to be written before TxDescAddrLow to work.
1910+
* Switching from MMIO to I/O access fixes the issue as well.
1911+
*/
19081912
RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32));
1909-
RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK));
1913+
RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK));
19101914
RTL_W32(RxDescAddrHigh, ((u64) tp->RxPhyAddr >> 32));
1915+
RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK));
19111916
RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
19121917
RTL_W8(Cfg9346, Cfg9346_Lock);
19131918

0 commit comments

Comments
 (0)