• Sean Wang's avatar
    net: ethernet: mediatek: add the whole ethernet reset into the reset process · 9ea4d311
    Sean Wang authored
    1) original driver only resets DMA used by descriptor rings
    which can't guarantee it can recover all various kinds of fatal
    errors, so the patch tries to reset the underlying hardware
    resource from scratch on Mediatek SoC required for ethernet
    running, including power, pin mux control, clock and internal
    circuits on the ethernet in order to restore into the initial
    state which the rebooted machine gives.
    
    2) add state variable inside structure mtk_eth to help distinguish
    mtk_hw_init is called between the initialization during boot time
    or re-initialization during the reset process.
    
    3) add ge_mode variable inside structure mtk_mac for restoring
    the interface mode of the current setup for the target MAC.
    
    4) remove __init attribute from mtk_hw_init definition
    Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9ea4d311
mtk_eth_soc.c 48 KB