]> git.baikalelectronics.ru Git - kernel.git/commit
rtw88: use shorter delay time to poll PS state
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Tue, 7 Jan 2020 14:27:29 +0000 (22:27 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Sun, 26 Jan 2020 15:42:56 +0000 (17:42 +0200)
commit40cda25aff2f26b86e2324cf6cc967c27f42e61b
treeef1238036a2448c3f5d2e656f5be5035a52d8bce
parenteac2253f6dfc2453d9f0bc62a2e192f7b27a6379
rtw88: use shorter delay time to poll PS state

When TX packet arrives, driver should leave deep PS state to make
sure the DMA is working. After requested to leave deep PS state,
driver needs to poll the PS state to check if the mode has been
changed successfully. The driver used to check the state of the
hardware every 20 msecs, which means upon the first failure of
state check, the CPU is delayed 20 msecs for next check. This is
harmful for some time-sensitive applications such as media players.

So, use shorter delay time each check from 20 msecs to 100 usecs.
The state should be changed in several tries. But we still need
to reserve ~15 msecs in total in case of the state just took too
long to be changed successfully. If the states of driver and the
hardware is not synchronized, the power state could be locked
forever, which mean we could never enter/leave the PS state.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtw88/ps.c