]> 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)
commit4019e4611a39b590b32a4b5d721be388db93632d
tree0a1a0d39fb3383e817560985d753e7bb287804c3
parente2acbe65d0c3a8e2973d9dcc6754cff93ff4997c
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