]> git.baikalelectronics.ru Git - kernel.git/commit
via-velocity: allow nesting of ethtool_ops begin() and complete()
authorMichal Kubecek <mkubecek@suse.cz>
Mon, 6 Jan 2020 06:39:36 +0000 (07:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jan 2020 21:54:55 +0000 (13:54 -0800)
commit0d86bb0ca8360c9ec8e04f440b6d70115f6143dd
tree332b30f367e5da1d56fade74257cc9f7030b25f5
parentd2f11e8a724ef11fff3b46d6e139623558ca1054
via-velocity: allow nesting of ethtool_ops begin() and complete()

Unlike most networking drivers using begin() and complete() ethtool_ops
callbacks to resume a device which is down and suspend it again when done,
via-velocity does not use standard refcounted infrastructure but sets
device sleep state directly.

With the introduction of netlink ethtool interface, we may have nested
begin-complete blocks so that inner complete() would put the device back to
sleep for the rest of the outer block.

To avoid rewriting an old and not very actively developed driver, just add
a nesting counter and only perform resume and suspend on the outermost
level.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/via/via-velocity.c
drivers/net/ethernet/via/via-velocity.h