• Grygorii Strashko's avatar
    drivers: net: cpsw: ethtool: fix accessing to suspended device · 7898b1da
    Grygorii Strashko authored
    The CPSW might be suspended by RPM if all ethX interfaces are down,
    but it still could be accesible through ethtool interfce. In this case
    ethtool operations, requiring registers access, will cause L3 errors and
    CPSW crash.
    
    ethtool callbcaks which need to access CPSW registers now:
    .set_coalesce(), .get_ethtool_stats(), .set_pauseparam(), .get_regs()
    
    Hence, fix it by adding .begin()/.complete() ethtool callbacks, which
    will be called before/after each ethtool operation runs, and do CPSW
    RPM handling in these callbacks. That way CPSW will be active while
    handling ethtool requests.
    Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7898b1da
cpsw.c 71 KB