diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2018-04-01 00:22:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-01 21:09:53 +0300 |
commit | 6e80e55bd37a90b412f168b1667ffa7d2debd46b (patch) | |
tree | a6a8423964703c9d4f9a94223f4b086b0e2bbe77 /drivers/net/ethernet/renesas/sh_eth.c | |
parent | 16c3c91346961fdd733ad232311772795599be7f (diff) | |
download | linux-6e80e55bd37a90b412f168b1667ffa7d2debd46b.tar.xz |
sh_eth: add sh_eth_cpu_data::no_xdfar flag
The commit 6ded286555c2 ("sh_eth: Fix RX recovery on R-Car in case of RX
ring underrun") added a check for an bad RDFAR offset in sh_eth_rx(), so
that the code could work on the R-Car Ether controllers which don't have
this register (and TDFAR), then the commit 3365711df02 ("sh_eth: WARN on
access to a register not implemented in a particular chip") replaced
offset 0 with 0xffff. Adding/checking the 'no_xdfar' bit field in the
'struct sh_eth_cpu_data' instead results in less object code...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/renesas/sh_eth.c')
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 306558ef36b5..2bff03345b72 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -702,6 +702,7 @@ static struct sh_eth_cpu_data rcar_gen1_data = { .mpr = 1, .tpauser = 1, .hw_swap = 1, + .no_xdfar = 1, }; /* R-Car Gen2 and RZ/G1 */ @@ -735,6 +736,7 @@ static struct sh_eth_cpu_data rcar_gen2_data = { .mpr = 1, .tpauser = 1, .hw_swap = 1, + .no_xdfar = 1, .rmiimode = 1, .magic = 1, }; @@ -1615,8 +1617,7 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota) /* If we don't need to check status, don't. -KDU */ if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) { /* fix the values for the next receiving if RDE is set */ - if (intr_status & EESR_RDE && - mdp->reg_offset[RDFAR] != SH_ETH_OFFSET_INVALID) { + if (intr_status & EESR_RDE && !mdp->cd->no_xdfar) { u32 count = (sh_eth_read(ndev, RDFAR) - sh_eth_read(ndev, RDLAR)) >> 4; |