[PATCH 2/2] rtw88: Use udelay instead of usleep in atomic context

From: Kai-Heng Feng
Date: Thu Apr 23 2020 - 02:38:28 EST


It's incorrect to use usleep in atomic context.

Switch to a macro which uses udelay instead of usleep to prevent the issue.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@xxxxxxxxxxxxx>
---
drivers/net/wireless/realtek/rtw88/fw.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
index 245da96dfddc..8f998b4a7234 100644
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -228,9 +228,9 @@ static void rtw_fw_send_h2c_command(struct rtw_dev *rtwdev,
goto out;
}

- ret = read_poll_timeout(rtw_read8, box_state,
- !((box_state >> box) & 0x1), 100, 3000, false,
- rtwdev, REG_HMETFR);
+ ret = read_poll_timeout_atomic(rtw_read8, box_state,
+ !((box_state >> box) & 0x1), 100, 3000,
+ false, rtwdev, REG_HMETFR);

if (ret) {
rtw_err(rtwdev, "failed to send h2c command\n");
--
2.17.1