ath9k_htc: make ->sta_rc_update atomic for most calls
PATCH 1/1 ath9k_htc: make ->sta_rc_update atomic for most calls
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
--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +13 -12
@@ -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);
Signature · 1 line
1.7.11.7
PATCH 1/1 ath9k_htc: make ->sta_rc_update atomic for most calls
Looks good,
thank you!
Am 28.01.2014 09:14, schrieb Stanislaw Gruszka:
Quoted 61 lines
sta_rc_update()callback must be atomic, hence we can not take mutexes or do other operations, which can sleep inath9k_htc_sta_rc_update().I think we can just return from
ath9k_htc_sta_rc_update(), if it is called withoutIEEE80211_RC_SUPP_RATES_CHANGEDbit. 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=990955Cc stable at vger.kernel.orgSigned-off-by Stanislaw Gruszka <[email protected]>--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)drivers/net/wireless/ath/ath9k/htc_drv_main.c +13
-12@@ -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);
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 295 bytes Desc: OpenPGP digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140128/7ad3875d/attachment.pgp