]> git.baikalelectronics.ru Git - kernel.git/commit
epic100: allow nesting of ethtool_ops begin() and complete()
authorMichal Kubecek <mkubecek@suse.cz>
Mon, 6 Jan 2020 06:39:41 +0000 (07:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jan 2020 21:54:55 +0000 (13:54 -0800)
commita38bfea6bd6d9d2180824208b27f8401a004321b
tree740867ad738275f4cbf4068f50e4aea0b3b572bd
parent0d86bb0ca8360c9ec8e04f440b6d70115f6143dd
epic100: 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,
epic100 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/smsc/epic100.c