Re: [PATCH net v1] lan743x: fix "BUG: invalid wait context" when setting rx mode

From: Jakub Kicinski
Date: Tue Nov 10 2020 - 20:55:13 EST


On Mon, 9 Nov 2020 15:38:28 -0500 Sven Van Asbroeck wrote:
> From: Sven Van Asbroeck <thesven73@xxxxxxxxx>
>
> In the net core, the struct net_device_ops -> ndo_set_rx_mode()
> callback is called with the dev->addr_list_lock spinlock held.
>
> However, this driver's ndo_set_rx_mode callback eventually calls
> lan743x_dp_write(), which acquires a mutex. Mutex acquisition
> may sleep, and this is not allowed when holding a spinlock.
>
> Fix by removing the dp_lock mutex entirely. Its purpose is to
> prevent concurrent accesses to the data port. No concurrent
> accesses are possible, because the dev->addr_list_lock
> spinlock in the core only lets through one thread at a time.

Please remember about fixes tags, I've added:

Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")

here. No idea what this lock was trying to protect from the start.

Applied, thanks!