aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2020-10-27 23:54:42 +0100
committerJakub Kicinski <kuba@kernel.org>2020-10-31 09:55:30 -0700
commitdc5e8bfcd12eec8032be83b334896c103cdef1aa (patch)
tree3209e2e889c85775cc96ee95e0934daded8aeed3 /drivers
parentnet: neterion: s2io: Replace in_interrupt() for context detection (diff)
downloadwireguard-linux-dc5e8bfcd12eec8032be83b334896c103cdef1aa.tar.xz
wireguard-linux-dc5e8bfcd12eec8032be83b334896c103cdef1aa.zip
net: forcedeth: Replace context and lock check with a lockdep_assert()
nv_update_stats() triggers a WARN_ON() when invoked from hard interrupt context because the locks in use are not hard interrupt safe. It also has an assert_spin_locked() which was the lock check before the lockdep era. Lockdep has way broader locking correctness checks and covers both issues, so replace the warning and the lock assert with lockdep_assert_held(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Rain River <rain.1986.08.12@gmail.com> Cc: Zhu Yanjun <zyjzyj2000@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/nvidia/forcedeth.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 2fc10a36afa4..7e85cf943be1 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -1666,11 +1666,7 @@ static void nv_update_stats(struct net_device *dev)
struct fe_priv *np = netdev_priv(dev);
u8 __iomem *base = get_hwbase(dev);
- /* If it happens that this is run in top-half context, then
- * replace the spin_lock of hwstats_lock with
- * spin_lock_irqsave() in calling functions. */
- WARN_ONCE(in_irq(), "forcedeth: estats spin_lock(_bh) from top-half");
- assert_spin_locked(&np->hwstats_lock);
+ lockdep_assert_held(&np->hwstats_lock);
/* query hardware */
np->estats.tx_bytes += readl(base + NvRegTxCnt);