0f4abb5
Kernel commits 41affd5 and 6539306 changed the locking in rtl_lps_leave()
0f4abb5
from a spinlock to a mutex by doing the calls indirectly from a work queue
0f4abb5
to reduce the time that interrupts were disabled. This change was fine for
0f4abb5
most systems; however a scheduling while atomic bug was reported in
0f4abb5
https://bugzilla.redhat.com/show_bug.cgi?id=903881. The backtrace indicates
0f4abb5
that routine rtl_is_special(), which calls rtl_lps_leave() in three places
0f4abb5
was entered in atomic context. These direct calls are replaced by putting a
0f4abb5
request on the appropriate work queue.
0f4abb5
0f4abb5
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
0f4abb5
Reported-and-tested-by: Nathaniel Doherty <ntdoherty@gmail.com>
0f4abb5
Cc: Nathaniel Doherty <ntdoherty@gmail.com>
0f4abb5
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
0f4abb5
Cc: Stable <stable@vger.kernel.org>
0f4abb5
---
0f4abb5
0f4abb5
John,
0f4abb5
0f4abb5
If DaveM will still accept bug fixes for 3.8, please push this one. It
0f4abb5
is unlikely to have any side effects.
0f4abb5
0f4abb5
Thanks,
0f4abb5
0f4abb5
Larry
0f4abb5
---
0f4abb5
0f4abb5
 base.c |    7 ++++---
0f4abb5
 1 file changed, 4 insertions(+), 3 deletions(-)
0f4abb5
0f4abb5
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/base.c
0f4abb5
===================================================================
0f4abb5
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/base.c
0f4abb5
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/base.c
0f4abb5
@@ -1004,7 +1004,8 @@ u8 rtl_is_special_data(struct ieee80211_
0f4abb5
 					 is_tx ? "Tx" : "Rx");
0f4abb5
 
0f4abb5
 				if (is_tx) {
0f4abb5
-					rtl_lps_leave(hw);
0f4abb5
+					schedule_work(&rtlpriv->
0f4abb5
+						      works.lps_leave_work);
0f4abb5
 					ppsc->last_delaylps_stamp_jiffies =
0f4abb5
 					    jiffies;
0f4abb5
 				}
0f4abb5
@@ -1014,7 +1015,7 @@ u8 rtl_is_special_data(struct ieee80211_
0f4abb5
 		}
0f4abb5
 	} else if (ETH_P_ARP == ether_type) {
0f4abb5
 		if (is_tx) {
0f4abb5
-			rtl_lps_leave(hw);
0f4abb5
+			schedule_work(&rtlpriv->works.lps_leave_work);
0f4abb5
 			ppsc->last_delaylps_stamp_jiffies = jiffies;
0f4abb5
 		}
0f4abb5
 
0f4abb5
@@ -1024,7 +1025,7 @@ u8 rtl_is_special_data(struct ieee80211_
0f4abb5
 			 "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx");
0f4abb5
 
0f4abb5
 		if (is_tx) {
0f4abb5
-			rtl_lps_leave(hw);
0f4abb5
+			schedule_work(&rtlpriv->works.lps_leave_work);
0f4abb5
 			ppsc->last_delaylps_stamp_jiffies = jiffies;
0f4abb5
 		}
0f4abb5
 
0f4abb5
--
0f4abb5
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
0f4abb5
the body of a message to majordomo@vger.kernel.org
0f4abb5
More majordomo info at  http://vger.kernel.org/majordomo-info.html