• Rakesh Sankaranarayanan's avatar
    net: phy: microchip: run phy initialization during each link update · d7bf56e0
    Rakesh Sankaranarayanan authored
    PHY initialization is supposed to run on every mode changes.
    "lan87xx_config_aneg()" verifies every mode change using
    "phy_modify_changed()" function. Earlier code had phy_modify_changed()
    followed by genphy_soft_reset. But soft_reset resets all the
    pre-configured register values to default state, and lost all the
    initialization done. With this reason gen_phy_reset was removed.
    But it need to go through init sequence each time the mode changed.
    Update lan87xx_config_aneg() to invoke phy_init once successful mode
    update is detected.
    
    PHY init sequence added in lan87xx_phy_init() have slave init
    commands executed every time. Update the init sequence to run
    slave init only if phydev is in slave mode.
    
    Test setup contains LAN9370 EVB connected to SAMA5D3 (Running DSA),
    and issue can be reproduced by connecting link to any of the available
    ports after SAMA5D3 boot-up. With this issue, port will fail to
    update link state. But once the SAMA5D3 is reset with LAN9370 link in
    connected state itself, on boot-up link state will be reported as UP. But
    Again after some time, if link is moved to DOWN state, it will not get
    reported.
    Signed-off-by: default avatarRakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
    Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
    Link: https://lore.kernel.org/r/20230120104733.724701-1-rakesh.sankaranarayanan@microchip.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    d7bf56e0
microchip_t1.c 25.1 KB