sh_eth: check sh_eth_cpu_data::no_xdfar when dumping registers
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sat, 15 Feb 2020 20:10:53 +0000 (23:10 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Feb 2020 03:44:41 +0000 (19:44 -0800)
When adding the sh_eth_cpu_data::no_xdfar flag I forgot to add the flag
check to  __sh_eth_get_regs(), causing the non-existing RDFAR/TDFAR to be
considered for dumping on the R-Car gen1/2 SoCs (the register offset check
has the final say here)...

Fixes: 4c1d45850d5 ("sh_eth: add sh_eth_cpu_data::cexcr flag")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Tested-by: Chris Brandt <chris.brandt@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/sh_eth.c

index ae9469c90ae2c7f5a9d38ab3a4b11964e384c2eb..44e8c2a5a7b691d304a0cd1e01f665ca39d621aa 100644 (file)
@@ -2140,11 +2140,13 @@ static size_t __sh_eth_get_regs(struct net_device *ndev, u32 *buf)
        add_reg(EESR);
        add_reg(EESIPR);
        add_reg(TDLAR);
-       add_reg(TDFAR);
+       if (!cd->no_xdfar)
+               add_reg(TDFAR);
        add_reg(TDFXR);
        add_reg(TDFFR);
        add_reg(RDLAR);
-       add_reg(RDFAR);
+       if (!cd->no_xdfar)
+               add_reg(RDFAR);
        add_reg(RDFXR);
        add_reg(RDFFR);
        add_reg(TRSCER);