diff options
author | Robert Hancock <hancock@sedsystems.ca> | 2019-06-06 16:28:11 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-06 16:24:29 -0700 |
commit | 7789e9ed0591bab4d8a419bf3b9b18327d75128f (patch) | |
tree | 097f925ed05d6dd6b3c30b5a9a3141ecead25b50 /drivers/net/ethernet/xilinx/xilinx_axienet.h | |
parent | net: axienet: fix teardown order of MDIO bus (diff) | |
download | linux-dev-7789e9ed0591bab4d8a419bf3b9b18327d75128f.tar.xz linux-dev-7789e9ed0591bab4d8a419bf3b9b18327d75128f.zip |
net: axienet: Re-initialize MDIO registers properly after reset
The MDIO clock divisor register setting was only applied on the initial
startup when the driver was loaded. However, this setting is cleared
when the device is reset, such as would occur when the interface was
taken down and brought up again, and so the MDIO bus would be
non-functional afterwards.
Split up the MDIO bus setup and enable into separate functions and
re-enable the bus after a device reset, to ensure that the MDIO
registers are set properly. This also allows us to remove direct access
to MDIO registers in xilinx_axienet_main.c and centralize them all in
xilinx_axienet_mdio.c.
Also, lock the MDIO bus lock around the device reset process, to avoid
MDIO accesses from occurring while the MDIO is disabled during the reset.
Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/xilinx/xilinx_axienet.h')
-rw-r--r-- | drivers/net/ethernet/xilinx/xilinx_axienet.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index f240ff1b7296..4a135ed6e8a3 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -505,8 +505,9 @@ static inline void axienet_iow(struct axienet_local *lp, off_t offset, } /* Function prototypes visible in xilinx_axienet_mdio.c for other files */ +int axienet_mdio_enable(struct axienet_local *lp); +void axienet_mdio_disable(struct axienet_local *lp); int axienet_mdio_setup(struct axienet_local *lp); -int axienet_mdio_wait_until_ready(struct axienet_local *lp); void axienet_mdio_teardown(struct axienet_local *lp); #endif /* XILINX_AXI_ENET_H */ |