]> git.baikalelectronics.ru Git - kernel.git/commit
net: watchdog: hold device global xmit lock during tx disable
authorEdwin Peer <edwin.peer@broadcom.com>
Sat, 6 Feb 2021 01:37:32 +0000 (17:37 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Feb 2021 00:18:58 +0000 (16:18 -0800)
commit74a736c2ec28b3d7076dda0d234e58b499d46dcb
tree044f908132ba3671debf843068c8f9c23728d464
parent5e43bd75ea970bbac579f796fc8b9743ad039a3b
net: watchdog: hold device global xmit lock during tx disable

Prevent netif_tx_disable() running concurrently with dev_watchdog() by
taking the device global xmit lock. Otherwise, the recommended:

netif_carrier_off(dev);
netif_tx_disable(dev);

driver shutdown sequence can happen after the watchdog has already
checked carrier, resulting in possible false alarms. This is because
netif_tx_lock() only sets the frozen bit without maintaining the locks
on the individual queues.

Fixes: a83e0cf53494 ("netdev: Fix lockdep warnings in multiqueue configurations.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h