• Robert Hancock's avatar
    net: axienet: Re-initialize MDIO registers properly after reset · 7789e9ed
    Robert Hancock authored
    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: default avatarRobert Hancock <hancock@sedsystems.ca>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7789e9ed
xilinx_axienet.h 20.8 KB