diff options
author | Sven Van Asbroeck <thesven73@gmail.com> | 2020-11-09 23:38:28 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-11 04:52:54 +0300 |
commit | 2b52a4b65bc8f14520fe6e996ea7fb3f7e400761 (patch) | |
tree | ef8debe210f0685a3dee8af7902eb00ae3ea7818 /drivers/net/ethernet/microchip/lan743x_main.h | |
parent | 2bae900b9419db3f3e43bbda3194657235fee096 (diff) | |
download | linux-2b52a4b65bc8f14520fe6e996ea7fb3f7e400761.tar.xz |
lan743x: fix "BUG: invalid wait context" when setting rx mode
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.
Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
Link: https://lore.kernel.org/r/20201109203828.5115-1-TheSven73@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/microchip/lan743x_main.h')
-rw-r--r-- | drivers/net/ethernet/microchip/lan743x_main.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/net/ethernet/microchip/lan743x_main.h b/drivers/net/ethernet/microchip/lan743x_main.h index c61a40411317..a536f4a4994d 100644 --- a/drivers/net/ethernet/microchip/lan743x_main.h +++ b/drivers/net/ethernet/microchip/lan743x_main.h @@ -712,9 +712,6 @@ struct lan743x_adapter { struct lan743x_csr csr; struct lan743x_intr intr; - /* lock, used to prevent concurrent access to data port */ - struct mutex dp_lock; - struct lan743x_gpio gpio; struct lan743x_ptp ptp; |