From bec647cdbcb5b98248fef5e4a58b5f34f5575dd1 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Tue, 28 Jan 2014 10:08:41 -0500 Subject: [PATCH] Add patch from Stanislaw Gruszka to fix ath9k BUG (rhbz 990955) --- ...-sta_rc_update-atomic-for-most-calls.patch | 65 +++++++++++++++++++ kernel.spec | 9 +++ 2 files changed, 74 insertions(+) create mode 100644 ath9k_htc-make-sta_rc_update-atomic-for-most-calls.patch diff --git a/ath9k_htc-make-sta_rc_update-atomic-for-most-calls.patch b/ath9k_htc-make-sta_rc_update-atomic-for-most-calls.patch new file mode 100644 index 000000000..bbfd57839 --- /dev/null +++ b/ath9k_htc-make-sta_rc_update-atomic-for-most-calls.patch @@ -0,0 +1,65 @@ +Bugzilla: 990955 +Upstream-status: Sent for 3.14, CC'd to stable + +sta_rc_update() callback must be atomic, hence we can not take mutexes +or do other operations, which can sleep in ath9k_htc_sta_rc_update(). + +I think we can just return from ath9k_htc_sta_rc_update(), if it is +called without IEEE80211_RC_SUPP_RATES_CHANGED bit. That will help +with scheduling while atomic bug for most cases (except mesh and IBSS +modes). + +For mesh and IBSS I do not see other solution like creating additional +workqueue, because sending firmware command require us to sleep, but +this can be done in additional patch. + +Patch partially fixes bug: +https://bugzilla.redhat.com/show_bug.cgi?id=990955 + +Cc: stable@vger.kernel.org +Signed-off-by: Stanislaw Gruszka +--- + drivers/net/wireless/ath/ath9k/htc_drv_main.c | 25 +++++++++++++------------ + 1 file changed, 13 insertions(+), 12 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c +index 608d739..a57af9b 100644 +--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c ++++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c +@@ -1315,21 +1315,22 @@ static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw, + struct ath_common *common = ath9k_hw_common(priv->ah); + struct ath9k_htc_target_rate trate; + ++ if (!(changed & IEEE80211_RC_SUPP_RATES_CHANGED)) ++ return; ++ + mutex_lock(&priv->mutex); + ath9k_htc_ps_wakeup(priv); + +- if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) { +- memset(&trate, 0, sizeof(struct ath9k_htc_target_rate)); +- ath9k_htc_setup_rate(priv, sta, &trate); +- if (!ath9k_htc_send_rate_cmd(priv, &trate)) +- ath_dbg(common, CONFIG, +- "Supported rates for sta: %pM updated, rate caps: 0x%X\n", +- sta->addr, be32_to_cpu(trate.capflags)); +- else +- ath_dbg(common, CONFIG, +- "Unable to update supported rates for sta: %pM\n", +- sta->addr); +- } ++ memset(&trate, 0, sizeof(struct ath9k_htc_target_rate)); ++ ath9k_htc_setup_rate(priv, sta, &trate); ++ if (!ath9k_htc_send_rate_cmd(priv, &trate)) ++ ath_dbg(common, CONFIG, ++ "Supported rates for sta: %pM updated, rate caps: 0x%X\n", ++ sta->addr, be32_to_cpu(trate.capflags)); ++ else ++ ath_dbg(common, CONFIG, ++ "Unable to update supported rates for sta: %pM\n", ++ sta->addr); + + ath9k_htc_ps_restore(priv); + mutex_unlock(&priv->mutex); +-- +1.7.11.7 diff --git a/kernel.spec b/kernel.spec index 9d3391f1a..798db8d77 100644 --- a/kernel.spec +++ b/kernel.spec @@ -763,6 +763,9 @@ Patch25183: ipv6-introduce-IFA_F_NOPREFIXROUTE-and-IFA_F_MANAGETEMPADDR-flags.pa #rhbz 1057533 Patch25184: i915-remove-pm_qos-request-on-error.patch +#rhbz 990955 +Patch25185: ath9k_htc-make-sta_rc_update-atomic-for-most-calls.patch + # END OF PATCH DEFINITIONS %endif @@ -1465,6 +1468,9 @@ ApplyPatch ipv6-introduce-IFA_F_NOPREFIXROUTE-and-IFA_F_MANAGETEMPADDR-flags.pat #rhbz 1057533 ApplyPatch i915-remove-pm_qos-request-on-error.patch +#rhbz 990955 +ApplyPatch ath9k_htc-make-sta_rc_update-atomic-for-most-calls.patch + # END OF PATCH APPLICATIONS %endif @@ -2277,6 +2283,9 @@ fi # and build. %changelog +* Tue Jan 28 2014 Josh Boyer +- Add patch from Stanislaw Gruszka to fix ath9k BUG (rhbz 990955) + * Mon Jan 27 2014 Justin M. Forbes - 3.12.9-200 - Backport new IPv6 address flag IFA_F_NOPREFIXROUTE and IFA_F_MANAGETEMPADDR (rhbz 1056711) - Linux v3.12.9