]> www.infradead.org Git - users/hch/misc.git/commit
eth: tg3: fix calling napi_enable() in atomic context
authorJakub Kicinski <kuba@kernel.org>
Fri, 24 Jan 2025 03:18:35 +0000 (19:18 -0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 27 Jan 2025 22:30:49 +0000 (14:30 -0800)
commit8ed47e4e0b428424e4c43704f12e9c1085f5425c
tree5893b881060698cfac12b484b0ff20b02ed1f596
parent964417a5d4a06614ef7fb3ae69bb17c91a2dc016
eth: tg3: fix calling napi_enable() in atomic context

tg3 has a spin lock protecting most of the config,
switch to taking netdev_lock() explicitly on enable/start
paths. Disable/stop paths seem to not be under the spin
lock (since napi_disable() already needs to sleep),
so leave that side as is.

tg3_restart_hw() releases and re-takes the spin lock,
we need to do the same because dev_close() needs to
take netdev_lock().

Fixes: 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/dcfd56bc-de32-4b11-9e19-d8bd1543745d@stanley.mountain
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250124031841.1179756-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/tg3.c