Skip to content

Commit de26859

Browse files
lwfingerKalle Valo
authored andcommitted
rtlwifi: Fix scheduling while atomic error from commit 49f86ec
Commit 49f86ec ("rtlwifi: Change long delays to sleeps") was correct for most cases; however, driver rtl8192ce calls the affected routines while in atomic context. The kernel bug output is as follows: BUG: scheduling while atomic: wpa_supplicant/627/0x00000002 [...] [<ffffffff815c2b39>] __schedule+0x899/0xad0 [<ffffffff815c2dac>] schedule+0x3c/0x90 [<ffffffff815c5bb2>] schedule_hrtimeout_range_clock+0xa2/0x120 [<ffffffff810e8b80>] ? hrtimer_init+0x120/0x120 [<ffffffff815c5ba6>] ? schedule_hrtimeout_range_clock+0x96/0x120 [<ffffffff815c5c43>] schedule_hrtimeout_range+0x13/0x20 [<ffffffff815c568f>] usleep_range+0x4f/0x70 [<ffffffffa0667218>] rtl_rfreg_delay+0x38/0x50 [rtlwifi] [<ffffffffa06dd0e7>] rtl92c_phy_config_rf_with_headerfile+0xc7/0xe0 [rtl8192ce] To fix this bug, three of the changes from delay to sleep are reverted. Unfortunately, one of the changes involves a delay of 50 msec. The calling code will be modified so that this long delay can be avoided; however, this change is being pushed now to fix the problem in kernel 4.6.0. Fixes: 49f86ec ("rtlwifi: Change long delays to sleeps") Reported-by: James Feeney <[email protected]> Signed-off-by: Larry Finger <[email protected]> Cc: James Feeney <[email protected]> Cc: Stable <[email protected]> [4.6+] Signed-off-by: Kalle Valo <[email protected]>
1 parent 94abd77 commit de26859

File tree

1 file changed

+3
-3
lines changed
  • drivers/net/wireless/realtek/rtlwifi

1 file changed

+3
-3
lines changed

drivers/net/wireless/realtek/rtlwifi/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ EXPORT_SYMBOL(channel5g_80m);
5454
void rtl_addr_delay(u32 addr)
5555
{
5656
if (addr == 0xfe)
57-
msleep(50);
57+
mdelay(50);
5858
else if (addr == 0xfd)
5959
msleep(5);
6060
else if (addr == 0xfc)
@@ -75,7 +75,7 @@ void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
7575
rtl_addr_delay(addr);
7676
} else {
7777
rtl_set_rfreg(hw, rfpath, addr, mask, data);
78-
usleep_range(1, 2);
78+
udelay(1);
7979
}
8080
}
8181
EXPORT_SYMBOL(rtl_rfreg_delay);
@@ -86,7 +86,7 @@ void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data)
8686
rtl_addr_delay(addr);
8787
} else {
8888
rtl_set_bbreg(hw, addr, MASKDWORD, data);
89-
usleep_range(1, 2);
89+
udelay(1);
9090
}
9191
}
9292
EXPORT_SYMBOL(rtl_bb_delay);

0 commit comments

Comments
 (0)