linux-brain/drivers/net/ethernet/microchip
Sven Van Asbroeck 0e2ad69bd4 lan743x: fix "BUG: invalid wait context" when setting rx mode
[ Upstream commit 2b52a4b65bc8f14520fe6e996ea7fb3f7e400761 ]

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: 23f0703c12 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-11-18 19:20:27 +01:00
..
enc28j60_hw.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
enc28j60.c enc28j60: Convert to use SPDX identifier 2019-03-19 14:59:32 -07:00
encx24j600_hw.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
encx24j600-regmap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
encx24j600.c net: microchip: encx24j600: add missed kthread_stop 2020-06-03 08:21:09 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
lan743x_ethtool.c lan743x: Provide Read/Write Access to on chip OTP 2019-01-26 09:35:21 -08:00
lan743x_ethtool.h lan743x: Add support for ethtool get_drvinfo 2018-07-23 14:09:18 -07:00
lan743x_main.c lan743x: fix "BUG: invalid wait context" when setting rx mode 2020-11-18 19:20:27 +01:00
lan743x_main.h lan743x: fix "BUG: invalid wait context" when setting rx mode 2020-11-18 19:20:27 +01:00
lan743x_ptp.c net: reject PTP periodic output requests with unsupported flags 2019-11-15 12:48:32 -08:00
lan743x_ptp.h net: lan743x: fix building without CONFIG_PTP_1588_CLOCK 2018-08-13 20:43:47 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00