All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksij Rempel <linux@rempel-privat.de>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH] ath9k_htc: make ->sta_rc_update atomic for most calls
Date: Tue, 28 Jan 2014 10:30:05 +0100	[thread overview]
Message-ID: <52E7789D.9010001@rempel-privat.de> (raw)
In-Reply-To: <20140128081433.GA1771@redhat.com>

Looks good,
thank you!

Am 28.01.2014 09:14, schrieb Stanislaw Gruszka:
> 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 at vger.kernel.org
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  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);
> 


-- 
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 

WARNING: multiple messages have this Message-ID (diff)
From: Oleksij Rempel <linux@rempel-privat.de>
To: Stanislaw Gruszka <sgruszka@redhat.com>, linux-wireless@vger.kernel.org
Cc: ath9k-devel@venema.h4ckr.net
Subject: Re: [PATCH] ath9k_htc: make ->sta_rc_update atomic for most calls
Date: Tue, 28 Jan 2014 10:30:05 +0100	[thread overview]
Message-ID: <52E7789D.9010001@rempel-privat.de> (raw)
In-Reply-To: <20140128081433.GA1771@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2571 bytes --]

Looks good,
thank you!

Am 28.01.2014 09:14, schrieb Stanislaw Gruszka:
> 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 <sgruszka@redhat.com>
> ---
>  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);
> 


-- 
Regards,
Oleksij


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

  reply	other threads:[~2014-01-28  9:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28  8:14 [ath9k-devel] [PATCH] ath9k_htc: make ->sta_rc_update atomic for most calls Stanislaw Gruszka
2014-01-28  8:14 ` Stanislaw Gruszka
2014-01-28  9:30 ` Oleksij Rempel [this message]
2014-01-28  9:30   ` Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52E7789D.9010001@rempel-privat.de \
    --to=linux@rempel-privat.de \
    --cc=ath9k-devel@lists.ath9k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.