]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: net: cpsw: ethtool: fix accessing to suspended device
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 24 Jun 2016 18:23:44 +0000 (21:23 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Jun 2016 12:57:18 +0000 (08:57 -0400)
commita3acc48215b7665a6ecf919175794cd51ba7a34a
tree0a1a0d39fb3383e817560985d753e7bb287804c3
parent5b713982da90628b8f4c4065526dccc0ae9d8e53
drivers: net: cpsw: ethtool: fix accessing to suspended device

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: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c