net: fec: don't dump RX FIFO register when not available
authorFugang Duan <fugang.duan@nxp.com>
Mon, 15 Oct 2018 05:19:00 +0000 (05:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Nov 2018 13:52:48 +0000 (14:52 +0100)
commitff96a397744084e6eb13ab4afe47add5c03435bf
tree6dd42d279f05dbb61d530cba8f4fa8cb5c9d28f5
parent6bb1381cc8650c9b86e41ea639db4dfaed750ad4
net: fec: don't dump RX FIFO register when not available

[ Upstream commit ec20a63aa8b8ec3223fb25cdb2a49f9f9dfda88c ]

Commit db65f35f50e0 ("net: fec: add support of ethtool get_regs") introduce
ethool "--register-dump" interface to dump all FEC registers.

But not all silicon implementations of the Freescale FEC hardware module
have the FRBR (FIFO Receive Bound Register) and FRSR (FIFO Receive Start
Register) register, so we should not be trying to dump them on those that
don't.

To fix it we create a quirk flag, FEC_QUIRK_HAS_RFREG, and check it before
dump those RX FIFO registers.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c