Skip to content

Commit 6ded286

Browse files
bwh-ctdavem330
authored andcommitted
sh_eth: Fix RX recovery on R-Car in case of RX ring underrun
In case of RX ring underrun (RDE), we attempt to reset the software descriptor pointers (dirty_rx and cur_rx) to match where the hardware will read the next descriptor from, as that might not be the first dirty descriptor. This relies on reading RDFAR, but that register doesn't exist on all supported chips - specifically, not on the R-Car chips. This will result in unpredictable behaviour on those chips after an RDE. Make this pointer reset conditional and assume that it isn't needed on the R-Car chips. This fix also assumes that RDFAR is never exposed at offset 0 in the memory map - this is currently true, and a subsequent commit will fix the ambiguity between offset 0 and no-offset in the register offset maps. Fixes: 79fba9f ("net: sh_eth: fix the rxdesc pointer when rx ...") Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7d7355f commit 6ded286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/renesas/sh_eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
15431543
/* If we don't need to check status, don't. -KDU */
15441544
if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) {
15451545
/* fix the values for the next receiving if RDE is set */
1546-
if (intr_status & EESR_RDE) {
1546+
if (intr_status & EESR_RDE && mdp->reg_offset[RDFAR] != 0) {
15471547
u32 count = (sh_eth_read(ndev, RDFAR) -
15481548
sh_eth_read(ndev, RDLAR)) >> 4;
15491549

0 commit comments

Comments
 (0)