2020-04-23 06:40:12

by Kai-Heng Feng

[permalink] [raw]
Subject: [PATCH 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.

Signed-off-by: Kai-Heng Feng <[email protected]>
---
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 06:55:14

by Kai-Heng Feng

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



> On Apr 23, 2020, at 14:49, Kalle Valo <[email protected]> wrote:
>
> Kai-Heng Feng <[email protected]> writes:
>
>> 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 <[email protected]>
>
> This fixes a regression, right? So there should be a Fixes line.

Yes, but the regression commit isn't in Linus' tree, so the sha1 may change.

Kai-Heng

>
> Also I can't take this until patch 1 is in my tree. And I don't know who
> takes iopoll.h patches.
>
> --
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2020-04-23 07:03:15

by Kalle Valo

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

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

>> On Apr 23, 2020, at 14:49, Kalle Valo <[email protected]> wrote:
>>
>> Kai-Heng Feng <[email protected]> writes:
>>
>>> 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 <[email protected]>
>>
>> This fixes a regression, right? So there should be a Fixes line.
>
> Yes, but the regression commit isn't in Linus' tree, so the sha1 may change.

No, the commit id won't change after I have commited the patch. I don't
rebase my trees.

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