]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Feb 2021 13:00:32 +0000 (14:00 +0100)
commit8d403a809c8f3e0dda2c1ff22d3ffad015349b02
tree1200976ffc063e060127a75badb26ae352aa9e64
parent8326059944a67ae36d9c59e769a63a745fa4fef1
net: watchdog: hold device global xmit lock during tx disable

commit 3aa6bce9af0e25b735c9c1263739a5639a336ae8 upstream.

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: c3f26a269c24 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/netdevice.h