[kernel/f17] Fix rtlwifi scheduling while atomic from Larry Finger (rhbz 903881)

Josh Boyer jwboyer at fedoraproject.org
Mon Feb 4 14:55:26 UTC 2013


commit 2ee545385820c59a228785003ffde7230c2bf234
Author: Josh Boyer <jwboyer at redhat.com>
Date:   Mon Feb 4 09:49:15 2013 -0500

    Fix rtlwifi scheduling while atomic from Larry Finger (rhbz 903881)

 kernel.spec                                   |   11 ++++-
 rtlwifi-Fix-scheduling-while-atomic-bug.patch |   65 +++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 1 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 7366bc1..b2f23cb 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -54,7 +54,7 @@ Summary: The Linux kernel
 # For non-released -rc kernels, this will be appended after the rcX and
 # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
 #
-%global baserelease 101
+%global baserelease 102
 %global fedora_build %{baserelease}
 
 # base_sublevel is the kernel version we're starting with and patching
@@ -754,6 +754,9 @@ Patch21239: Revert-iwlwifi-fix-the-reclaimed-packet-tracking-upon.patch
 Patch21240: Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch
 Patch21242: Input-add-support-for-Cypress-PS2-Trackpads.patch
 
+#rhbz 903881
+Patch21246: rtlwifi-Fix-scheduling-while-atomic-bug.patch
+
 # END OF PATCH DEFINITIONS
 
 %endif
@@ -1457,6 +1460,9 @@ ApplyPatch Revert-iwlwifi-fix-the-reclaimed-packet-tracking-upon.patch
 ApplyPatch Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch
 ApplyPatch Input-add-support-for-Cypress-PS2-Trackpads.patch
 
+#rhbz 903881
+ApplyPatch rtlwifi-Fix-scheduling-while-atomic-bug.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2312,6 +2318,9 @@ fi
 #    '-'      |  |
 #              '-'
 %changelog
+* Mon Feb 04 2013 Josh Boyer <jwboyer at redhat.com> - 3.7.6-102
+- Fix rtlwifi scheduling while atomic from Larry Finger (rhbz 903881)
+
 * Mon Feb 04 2013 Justin M. Forbes <jforbes at redhat.com> - 3.7.6-101
 - Linux v3.7.6
 
diff --git a/rtlwifi-Fix-scheduling-while-atomic-bug.patch b/rtlwifi-Fix-scheduling-while-atomic-bug.patch
new file mode 100644
index 0000000..d05b104
--- /dev/null
+++ b/rtlwifi-Fix-scheduling-while-atomic-bug.patch
@@ -0,0 +1,65 @@
+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 at lwfinger.net>
+Reported-and-tested-by: Nathaniel Doherty <ntdoherty at gmail.com>
+Cc: Nathaniel Doherty <ntdoherty at gmail.com>
+Cc: Stanislaw Gruszka <sgruszka at redhat.com>
+Cc: Stable <stable at vger.kernel.org>
+---
+
+John,
+
+If DaveM will still accept bug fixes for 3.8, please push this one. It
+is unlikely to have any side effects.
+
+Thanks,
+
+Larry
+---
+
+ base.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+Index: wireless-testing-new/drivers/net/wireless/rtlwifi/base.c
+===================================================================
+--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/base.c
++++ wireless-testing-new/drivers/net/wireless/rtlwifi/base.c
+@@ -1004,7 +1004,8 @@ u8 rtl_is_special_data(struct ieee80211_
+ 					 is_tx ? "Tx" : "Rx");
+ 
+ 				if (is_tx) {
+-					rtl_lps_leave(hw);
++					schedule_work(&rtlpriv->
++						      works.lps_leave_work);
+ 					ppsc->last_delaylps_stamp_jiffies =
+ 					    jiffies;
+ 				}
+@@ -1014,7 +1015,7 @@ u8 rtl_is_special_data(struct ieee80211_
+ 		}
+ 	} else if (ETH_P_ARP == ether_type) {
+ 		if (is_tx) {
+-			rtl_lps_leave(hw);
++			schedule_work(&rtlpriv->works.lps_leave_work);
+ 			ppsc->last_delaylps_stamp_jiffies = jiffies;
+ 		}
+ 
+@@ -1024,7 +1025,7 @@ u8 rtl_is_special_data(struct ieee80211_
+ 			 "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx");
+ 
+ 		if (is_tx) {
+-			rtl_lps_leave(hw);
++			schedule_work(&rtlpriv->works.lps_leave_work);
+ 			ppsc->last_delaylps_stamp_jiffies = jiffies;
+ 		}
+ 
+--
+To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
+the body of a message to majordomo at vger.kernel.org
+More majordomo info at  http://vger.kernel.org/majordomo-info.html
\ No newline at end of file


More information about the scm-commits mailing list