diff options
author | Pavel Skripkin <paskripkin@gmail.com> | 2021-09-08 22:43:09 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-13 18:17:26 +0200 |
commit | 590b03a8829f32e338288be036dea0207e42b4fe (patch) | |
tree | 11812dce0d8809c267c36801e53d4a15c267633f /drivers/staging/r8188eu/os_dep | |
parent | e4c1935ed303accb6f89770f03ed5e2740e57c61 (diff) |
staging: r8188eu: make _rtw_init_queue a macro
While testing latest updates I hit lockdep warning:
[ 42.694425] ============================================
[ 42.694785] WARNING: possible recursive locking detected
[ 42.695120] 5.14.0+ #25 Tainted: G C
[ 42.695422] --------------------------------------------
[ 42.695747] RTW_CMD_THREAD/317 is trying to acquire lock:
[ 42.696078] ffffc900006c90b0 (&pqueue->lock){+.-.}-{3:3}, at: _rtw_alloc_network+0x1e/0x321 [r8188eu]
[ 42.696686]
[ 42.696686] but task is already holding lock:
[ 42.697148] ffffc900006c9100 (&pqueue->lock){+.-.}-{3:3}, at: rtw_update_scanned_network+0x31/0x76b [r8188eu]
[ 42.697758]
[ 42.697758] other info that might help us debug this:
[ 42.698326] Possible unsafe locking scenario:
[ 42.698326]
[ 42.698696] CPU0
[ 42.698847] ----
[ 42.698997] lock(&pqueue->lock);
[ 42.699209] lock(&pqueue->lock);
[ 42.699418]
[ 42.699418] *** DEADLOCK ***
[ 42.699418]
[ 42.699768] May be due to missing lock nesting notation
It's false positive, since all queue spinlocks are initialized via
private API which has pqueue as agrument. Fix it by making
_rtw_init_queue a macro instead of function + removed unneeded _ prefix.
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20210908194309.9086-1-paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/r8188eu/os_dep')
-rw-r--r-- | drivers/staging/r8188eu/os_dep/osdep_service.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/staging/r8188eu/os_dep/osdep_service.c b/drivers/staging/r8188eu/os_dep/osdep_service.c index cbe4f52c4a09..bee6d42b8738 100644 --- a/drivers/staging/r8188eu/os_dep/osdep_service.c +++ b/drivers/staging/r8188eu/os_dep/osdep_service.c @@ -67,12 +67,6 @@ u32 _rtw_down_sema(struct semaphore *sema) return _SUCCESS; } -void _rtw_init_queue(struct __queue *pqueue) -{ - INIT_LIST_HEAD(&pqueue->queue); - spin_lock_init(&pqueue->lock); -} - inline u32 rtw_systime_to_ms(u32 systime) { return systime * 1000 / HZ; |