diff options
author | Yan-Hsuan Chuang <yhchuang@realtek.com> | 2019-10-02 10:31:22 +0800 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-10-02 07:33:44 +0300 |
commit | d3e20fd17d0b6891a3b6f598abad38da2ab6a70f (patch) | |
tree | 5e921f8d0282b3f587e7cdc304ba5e245deb7cdc /drivers/net/wireless/realtek/rtw88/ps.c | |
parent | 5235d63640c60ad5384310bd88ce0a6d8f87179e (diff) |
rtw88: LPS enter/leave should be protected by lock
Protect LPS enter/leave routine with rtwdev->mutex.
This helps to synchronize with driver's states correctly.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/ps.c')
-rw-r--r-- | drivers/net/wireless/realtek/rtw88/ps.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/ps.c b/drivers/net/wireless/realtek/rtw88/ps.c index d57996e446fb..af5c7be2ef0f 100644 --- a/drivers/net/wireless/realtek/rtw88/ps.c +++ b/drivers/net/wireless/realtek/rtw88/ps.c @@ -95,6 +95,8 @@ void rtw_enter_lps(struct rtw_dev *rtwdev, u8 port_id) { struct rtw_lps_conf *conf = &rtwdev->lps_conf; + lockdep_assert_held(&rtwdev->mutex); + if (test_bit(RTW_FLAG_LEISURE_PS, rtwdev->flags)) return; @@ -108,6 +110,8 @@ void rtw_leave_lps(struct rtw_dev *rtwdev) { struct rtw_lps_conf *conf = &rtwdev->lps_conf; + lockdep_assert_held(&rtwdev->mutex); + if (!test_bit(RTW_FLAG_LEISURE_PS, rtwdev->flags)) return; |