2020-04-23 07:32:12

by Kai-Heng Feng

[permalink] [raw]
Subject: [PATCH v2 2/2] rtw88: Use udelay instead of usleep in atomic context

It's incorrect to use usleep in atomic context.

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

Fixes: 6343a6d4b213 ("rtw88: Add delay on polling h2c command status bit")
Signed-off-by: Kai-Heng Feng <[email protected]>
---
v2:
- Add Fixes tag.

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


2020-04-23 16:08:34

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] rtw88: Use udelay instead of usleep in atomic context

Kai-Heng Feng <[email protected]> wrote:

> It's incorrect to use usleep in atomic context.
>
> Switch to a macro which uses udelay instead of usleep to prevent the issue.
>
> Fixes: 6343a6d4b213 ("rtw88: Add delay on polling h2c command status bit")
> Signed-off-by: Kai-Heng Feng <[email protected]>

For patch 1 please also CC linux-wireless, otherwise patchwork cannot see it.

--
https://patchwork.kernel.org/patch/11505147/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches