]> git.baikalelectronics.ru Git - kernel.git/commit
rtw88: avoid holding mutex for cancel_delayed_work_sync()
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Wed, 5 Feb 2020 07:08:56 +0000 (15:08 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 12 Feb 2020 16:18:28 +0000 (18:18 +0200)
commita8e14bc5f44a2b1a3d54f387f6756d0ccaad1228
treed4b81ce5f77c738c8b5acf026395c40d53e1d6c0
parent093ca10799928f09ee3fbce74f2c5e1e70841619
rtw88: avoid holding mutex for cancel_delayed_work_sync()

Driver could possibly be dead-locked while canceling works with
*_sync() with mutex lock held. Those cancel_delayed_work_sync()
functions will wait until the work is done, but if we hold the
lock, they will never acquire the lock.

To prevent this, simply release the lock and acquire again after
the works have been canceled. And to avoid the works being queued
again, check if the device is at RTW_FLAG_RUNNING state, otherwise
just return and do nothing.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtw88/coex.c
drivers/net/wireless/realtek/rtw88/fw.c
drivers/net/wireless/realtek/rtw88/main.c