Skip to content

Commit a5ffbe0

Browse files
lwfingerlinvjw
authored andcommitted
rtlwifi: Fix scheduling while atomic bug
Kernel commits 41affd5 and 6539306 changed the locking in rtl_lps_leave() from a spinlock to a mutex by doing the calls indirectly from a work queue to reduce the time that interrupts were disabled. This change was fine for most systems; however a scheduling while atomic bug was reported in https://bugzilla.redhat.com/show_bug.cgi?id=903881. The backtrace indicates that routine rtl_is_special(), which calls rtl_lps_leave() in three places was entered in atomic context. These direct calls are replaced by putting a request on the appropriate work queue. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Reported-and-tested-by: Nathaniel Doherty <ntdoherty@gmail.com> Cc: Nathaniel Doherty <ntdoherty@gmail.com> Cc: Stanislaw Gruszka <sgruszka@redhat.com> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 4c52d3d commit a5ffbe0

File tree

1 file changed

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

1 file changed

+4
-3
lines changed

drivers/net/wireless/rtlwifi/base.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,8 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
10041004
is_tx ? "Tx" : "Rx");
10051005

10061006
if (is_tx) {
1007-
rtl_lps_leave(hw);
1007+
schedule_work(&rtlpriv->
1008+
works.lps_leave_work);
10081009
ppsc->last_delaylps_stamp_jiffies =
10091010
jiffies;
10101011
}
@@ -1014,7 +1015,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
10141015
}
10151016
} else if (ETH_P_ARP == ether_type) {
10161017
if (is_tx) {
1017-
rtl_lps_leave(hw);
1018+
schedule_work(&rtlpriv->works.lps_leave_work);
10181019
ppsc->last_delaylps_stamp_jiffies = jiffies;
10191020
}
10201021

@@ -1024,7 +1025,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
10241025
"802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx");
10251026

10261027
if (is_tx) {
1027-
rtl_lps_leave(hw);
1028+
schedule_work(&rtlpriv->works.lps_leave_work);
10281029
ppsc->last_delaylps_stamp_jiffies = jiffies;
10291030
}
10301031

0 commit comments

Comments
 (0)