]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: eth: remove locking from ndo_open() 24482/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Thu, 30 Jul 2026 06:17:05 +0000 (08:17 +0200)
committerMarkus Stockhausen <markus.stockhausen@gmx.de>
Thu, 30 Jul 2026 15:59:21 +0000 (17:59 +0200)
commitdf3f1d24b686572390afd57a5a4b6facaf26a303
tree413ecb7732560ff574a02d4bfb2f3296fb1c7a09
parentf2f7fdd33a50fcaabf14684eb9f4c1f6866f577d
realtek: eth: remove locking from ndo_open()

ndo_open() runs under rtnl_lock() nevertheless the driver adds
its own locking and disables interrupts. Additionally it sleeps
inside some of the sub functions. This leads to spurious errors:

[   11.233001] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:271
[   11.233029] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 710, name: ip
[   11.233040] preempt_count: ffffffff, expected: 0
[   11.233055] CPU: 0 UID: 0 PID: 710 Comm: ip Tainted: G        W  O        6.18.39 #0 NONE
[   11.233082] Hardware name: Hasivo S1100W-8XGT-SE
[   11.233290] Call Trace:
[   11.233294] [<80112108>] show_stack+0x28/0xf0
[   11.233337] [<8010bb78>] dump_stack_lvl+0x70/0xb0
[   11.233378] [<80168b80>] __might_resched+0x144/0x15c
[   11.233417] [<808f2b6c>] mutex_lock+0x20/0x6c
[   11.233451] [<80669ad8>] __dev_open+0x14c/0x230
[   11.233493] [<80669c00>] netif_open+0x44/0x94
[   11.233512] [<8066e51c>] dev_open+0x40/0x78

Remove that anti-pattern.

Link: https://github.com/openwrt/openwrt/pull/24482
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
target/linux/realtek/files-6.18/drivers/net/ethernet/rtl838x_eth.c