Hi, while testing hostapd with hwsim, the following deadlock was reported: [ 500.865102] ============================================ [ 500.865106] WARNING: possible recursive locking detected [ 500.865112] 5.4.8-arch1-1 #1 Not tainted [ 500.865117] -------------------------------------------- [ 500.865122] kworker/3:0/36 is trying to acquire lock: [ 500.865127] ffff8881acdf0d08 (&wdev->mtx){+.+.}, at: cfg80211_stop_ap+0x37/0x60 [cfg80211] [ 500.865249] but task is already holding lock: [ 500.865253] ffff8881acdf0d08 (&wdev->mtx){+.+.}, at: cfg80211_autodisconnect_wk+0x3d/0x190 [cfg80211] [ 500.865354] other info that might help us debug this: [ 500.865358] Possible unsafe locking scenario: [ 500.865363] CPU0 [ 500.865366] ---- [ 500.865369] lock(&wdev->mtx); [ 500.865373] lock(&wdev->mtx); [ 500.865378] *** DEADLOCK *** [ 500.865382] May be due to missing lock nesting notation [ 500.865388] 3 locks held by kworker/3:0/36: [ 500.865391] #0: ffff8881d4c22148 ((wq_completion)events){+.+.}, at: process_one_work+0x4ee/0xac0 [ 500.865407] #1: ffff8881d4327dc8 ((work_completion)(&wdev->disconnect_wk)){+.+.}, at: process_one_work+0x4ee/0xac0 [ 500.865418] #2: ffff8881acdf0d08 (&wdev->mtx){+.+.}, at: cfg80211_autodisconnect_wk+0x3d/0x190 [cfg80211] [ 500.865517] stack backtrace: [ 500.865524] CPU: 3 PID: 36 Comm: kworker/3:0 Not tainted 5.4.8-arch1-1 #1 [ 500.865530] Hardware name: LENOVO 2349QM6/2349QM6, BIOS G1ETC2WW (2.82 ) 08/07/2019 [ 500.865628] Workqueue: events cfg80211_autodisconnect_wk [cfg80211] [ 500.865634] Call Trace: [ 500.865645] dump_stack+0xb8/0x110 [ 500.865654] __lock_acquire.cold+0xe2/0x212 [ 500.865672] ? lockdep_hardirqs_on+0x260/0x260 [ 500.865681] ? find_held_lock+0x8c/0xa0 [ 500.865693] lock_acquire+0xe5/0x220 [ 500.865772] ? cfg80211_stop_ap+0x37/0x60 [cfg80211] [ 500.865783] __mutex_lock+0x137/0xd00 [ 500.865864] ? cfg80211_stop_ap+0x37/0x60 [cfg80211] [ 500.865873] ? preempt_count_sub+0x14/0xc0 [ 500.865880] ? __mutex_lock+0x71f/0xd00 [ 500.865888] ? find_first_zero_bit+0x28/0x50 [ 500.865977] ? cfg80211_stop_ap+0x37/0x60 [cfg80211] [ 500.865986] ? mutex_lock_io_nested+0xc20/0xc20 [ 500.866090] ? cfg80211_autodisconnect_wk+0x3d/0x190 [cfg80211] [ 500.866098] ? mutex_lock_io_nested+0xc20/0xc20 [ 500.866109] ? lockdep_hardirqs_on+0x260/0x260 [ 500.866116] ? match_held_lock+0x2e/0x240 [ 500.866127] ? preempt_count_sub+0x14/0xc0 [ 500.866224] ? cfg80211_stop_ap+0x37/0x60 [cfg80211] [ 500.866322] cfg80211_stop_ap+0x37/0x60 [cfg80211] [ 500.866433] cfg80211_autodisconnect_wk+0xd5/0x190 [cfg80211] [ 500.866445] process_one_work+0x5c0/0xac0 [ 500.866460] ? pwq_dec_nr_in_flight+0x110/0x110 [ 500.866480] worker_thread+0x7a/0x690 [ 500.866497] kthread+0x1ab/0x200 [ 500.866505] ? process_one_work+0xac0/0xac0 [ 500.866511] ? kthread_create_on_node+0xd0/0xd0 [ 500.866521] ret_from_fork+0x3a/0x50 Markus