* [PATCH] b43: Replace mdelay with msleep in b43_radio_2057_init_post
@ 2017-12-24 4:03 Jia-Ju Bai
0 siblings, 0 replies; 3+ messages in thread
From: Jia-Ju Bai @ 2017-12-24 4:03 UTC (permalink / raw)
To: kvalo, colin.king, johannes.berg, tiwai, kstewart, gregkh,
andrew.zaborowski
Cc: linux-wireless, b43-dev, netdev, linux-kernel, Jia-Ju Bai
b43_radio_2057_init_post is not called in an interrupt handler
nor holding a spinlock.
The function mdelay in it can be replaced with msleep, to reduce busy wait.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
drivers/net/wireless/broadcom/b43/phy_n.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/b43/phy_n.c b/drivers/net/wireless/broadcom/b43/phy_n.c
index a5557d7..5bc838e 100644
--- a/drivers/net/wireless/broadcom/b43/phy_n.c
+++ b/drivers/net/wireless/broadcom/b43/phy_n.c
@@ -1031,7 +1031,7 @@ static void b43_radio_2057_init_post(struct b43_wldev *dev)
b43_radio_set(dev, R2057_RFPLL_MISC_CAL_RESETN, 0x78);
b43_radio_set(dev, R2057_XTAL_CONFIG2, 0x80);
- mdelay(2);
+ msleep(2);
b43_radio_mask(dev, R2057_RFPLL_MISC_CAL_RESETN, ~0x78);
b43_radio_mask(dev, R2057_XTAL_CONFIG2, ~0x80);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] b43: Replace mdelay with msleep in b43_radio_2057_init_post
@ 2017-12-30 11:08 Jia-Ju Bai
2017-12-30 18:49 ` Larry Finger
0 siblings, 1 reply; 3+ messages in thread
From: Jia-Ju Bai @ 2017-12-30 11:08 UTC (permalink / raw)
To: kvalo, colin.king, johannes.berg, tiwai, kstewart, gregkh,
andrew.zaborowski
Cc: linux-wireless, b43-dev, netdev, linux-kernel, Jia-Ju Bai
b43_radio_2057_init_post is not called in an interrupt handler
nor holding a spinlock.
The function mdelay in it can be replaced with msleep, to reduce busy wait.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
drivers/net/wireless/broadcom/b43/phy_n.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/b43/phy_n.c b/drivers/net/wireless/broadcom/b43/phy_n.c
index a5557d7..5bc838e 100644
--- a/drivers/net/wireless/broadcom/b43/phy_n.c
+++ b/drivers/net/wireless/broadcom/b43/phy_n.c
@@ -1031,7 +1031,7 @@ static void b43_radio_2057_init_post(struct b43_wldev *dev)
b43_radio_set(dev, R2057_RFPLL_MISC_CAL_RESETN, 0x78);
b43_radio_set(dev, R2057_XTAL_CONFIG2, 0x80);
- mdelay(2);
+ msleep(2);
b43_radio_mask(dev, R2057_RFPLL_MISC_CAL_RESETN, ~0x78);
b43_radio_mask(dev, R2057_XTAL_CONFIG2, ~0x80);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] b43: Replace mdelay with msleep in b43_radio_2057_init_post
2017-12-30 11:08 Jia-Ju Bai
@ 2017-12-30 18:49 ` Larry Finger
0 siblings, 0 replies; 3+ messages in thread
From: Larry Finger @ 2017-12-30 18:49 UTC (permalink / raw)
To: Jia-Ju Bai, kvalo, colin.king, johannes.berg, tiwai, kstewart,
gregkh, andrew.zaborowski
Cc: linux-wireless, b43-dev, netdev, linux-kernel
On 12/30/2017 05:08 AM, Jia-Ju Bai wrote:
> b43_radio_2057_init_post is not called in an interrupt handler
> nor holding a spinlock.
> The function mdelay in it can be replaced with msleep, to reduce busy wait.
>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
checkpatch.pl reports the following warning for this patch:
WARNING: msleep < 20ms can sleep for up to 20ms; see
Documentation/timers/timers-howto.txt
#26: FILE: drivers/net/wireless/broadcom/b43/phy_n.c:1034:
+ msleep(2);
total: 0 errors, 1 warnings, 0 checks, 8 lines checked
Have you tested to verify that a sleep as long as 20 ms will not cause problems?
The referenced document suggests a usleep_range() call.
In general, delay changes should never be proposed without testing.
Larry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-30 18:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-24 4:03 [PATCH] b43: Replace mdelay with msleep in b43_radio_2057_init_post Jia-Ju Bai
-- strict thread matches above, loose matches on Subject: below --
2017-12-30 11:08 Jia-Ju Bai
2017-12-30 18:49 ` Larry Finger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).