OSDN Git Service

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)
commit71f711a4f1dd1f6ebc26870ef17ae79581f37ae7
tree332b30f367e5da1d56fade74257cc9f7030b25f5
parenta69faa09102bd2138bac5eea9d27dcf196118832
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