]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 24 Mar 2021 10:14:34 +0000 (11:14 +0100)
commit930c41a591623fe615bb3a4c5ea8af89154c6bf4
tree9dfade4b04061768c446bafe315630b0937b740a
parent9335818d8025103421b98fb9d9592fcf7fd8cfdb
net: watchdog: hold device global xmit lock during tx disable

BugLink: https://bugs.launchpad.net/bugs/1918167
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
include/linux/netdevice.h