Commit 49f86ec2 authored by Larry Finger's avatar Larry Finger Committed by Kalle Valo

rtlwifi: Change long delays to sleeps

Routine rtl_addr_delay() uses delay statements in code that can
sleep. To improve system responsiveness, the various delay statements
are changed.

In addition, routines rtl_rfreg_delay() and rtl_bb_delay() are
rewritten to use the code in rtl_addr_delay() for most of their
input values.
Suggested-by: default avatarByeoungwook Kim <quddnr145@gmail.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 2f10e50e
...@@ -54,59 +54,39 @@ EXPORT_SYMBOL(channel5g_80m); ...@@ -54,59 +54,39 @@ EXPORT_SYMBOL(channel5g_80m);
void rtl_addr_delay(u32 addr) void rtl_addr_delay(u32 addr)
{ {
if (addr == 0xfe) if (addr == 0xfe)
mdelay(50); msleep(50);
else if (addr == 0xfd) else if (addr == 0xfd)
mdelay(5); msleep(5);
else if (addr == 0xfc) else if (addr == 0xfc)
mdelay(1); msleep(1);
else if (addr == 0xfb) else if (addr == 0xfb)
udelay(50); usleep_range(50, 100);
else if (addr == 0xfa) else if (addr == 0xfa)
udelay(5); usleep_range(5, 10);
else if (addr == 0xf9) else if (addr == 0xf9)
udelay(1); usleep_range(1, 2);
} }
EXPORT_SYMBOL(rtl_addr_delay); EXPORT_SYMBOL(rtl_addr_delay);
void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr, void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
u32 mask, u32 data) u32 mask, u32 data)
{ {
if (addr == 0xfe) { if (addr >= 0xf9 && addr <= 0xfe) {
mdelay(50); rtl_addr_delay(addr);
} else if (addr == 0xfd) {
mdelay(5);
} else if (addr == 0xfc) {
mdelay(1);
} else if (addr == 0xfb) {
udelay(50);
} else if (addr == 0xfa) {
udelay(5);
} else if (addr == 0xf9) {
udelay(1);
} else { } else {
rtl_set_rfreg(hw, rfpath, addr, mask, data); rtl_set_rfreg(hw, rfpath, addr, mask, data);
udelay(1); usleep_range(1, 2);
} }
} }
EXPORT_SYMBOL(rtl_rfreg_delay); EXPORT_SYMBOL(rtl_rfreg_delay);
void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data) void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data)
{ {
if (addr == 0xfe) { if (addr >= 0xf9 && addr <= 0xfe) {
mdelay(50); rtl_addr_delay(addr);
} else if (addr == 0xfd) {
mdelay(5);
} else if (addr == 0xfc) {
mdelay(1);
} else if (addr == 0xfb) {
udelay(50);
} else if (addr == 0xfa) {
udelay(5);
} else if (addr == 0xf9) {
udelay(1);
} else { } else {
rtl_set_bbreg(hw, addr, MASKDWORD, data); rtl_set_bbreg(hw, addr, MASKDWORD, data);
udelay(1); usleep_range(1, 2);
} }
} }
EXPORT_SYMBOL(rtl_bb_delay); EXPORT_SYMBOL(rtl_bb_delay);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment