Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] mac80211: delete addba_resp_timer when stop Tx BA session
@ 2009-12-28  3:18 Zhu Yi
  2009-12-28  8:18 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Zhu Yi @ 2009-12-28  3:18 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Johannes Berg

We start an one shot addba_resp_timer in ieee80211_start_tx_ba_session
but don't delete it in __ieee80211_stop_tx_ba_session. This will cause
problem in suspend and resume. When suspend happens without the timer
deleted, the timer handler will be called immediately after resume and
messes up driver status.

See http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2134
comment #22 for more details.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 net/mac80211/agg-tx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index ceda366..d122082 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -509,6 +509,8 @@ int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
 	u8 *state;
 	int ret;
 
+	del_timer_sync(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
+
 	/* check if the TID is in aggregation */
 	state = &sta->ampdu_mlme.tid_state_tx[tid];
 	spin_lock_bh(&sta->lock);
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: delete addba_resp_timer when stop Tx BA session
  2009-12-28  3:18 [PATCH] mac80211: delete addba_resp_timer when stop Tx BA session Zhu Yi
@ 2009-12-28  8:18 ` Johannes Berg
  2009-12-28 16:10   ` Luis R. Rodriguez
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2009-12-28  8:18 UTC (permalink / raw)
  To: Zhu Yi; +Cc: linville, linux-wireless

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

On Mon, 2009-12-28 at 11:18 +0800, Zhu Yi wrote:
> We start an one shot addba_resp_timer in ieee80211_start_tx_ba_session
> but don't delete it in __ieee80211_stop_tx_ba_session. This will cause
> problem in suspend and resume. When suspend happens without the timer
> deleted, the timer handler will be called immediately after resume and
> messes up driver status.
> 
> See http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2134
> comment #22 for more details.

Hmm. The timer checks

        if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) !=
                                                HT_ADDBA_REQUESTED_MSK) {

which /should/ make it a no-op in the case you mention because we tear
down sessions, or does that not reset their state properly?

Ok, so ___ieee80211_stop_tx_ba_session() doesn't, in fact, clear the
mask right away, so I think we should add HT_AGG_STATE_REQ_STOP_BA_MSK
to the code I quoted above?

In any case the del_timer_sync isn't right there and we also shouldn't
really use it (per Linus)

johannes

> Cc: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> ---
>  net/mac80211/agg-tx.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
> index ceda366..d122082 100644
> --- a/net/mac80211/agg-tx.c
> +++ b/net/mac80211/agg-tx.c
> @@ -509,6 +509,8 @@ int __ieee80211_stop_tx_ba_session(struct sta_info
> *sta, u16 tid,
>  	u8 *state;
>  	int ret;
>  
> +	del_timer_sync(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
> +
>  	/* check if the TID is in aggregation */
>  	state = &sta->ampdu_mlme.tid_state_tx[tid];
>  	spin_lock_bh(&sta->lock);


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: delete addba_resp_timer when stop Tx BA session
  2009-12-28  8:18 ` Johannes Berg
@ 2009-12-28 16:10   ` Luis R. Rodriguez
  0 siblings, 0 replies; 3+ messages in thread
From: Luis R. Rodriguez @ 2009-12-28 16:10 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Zhu Yi, linville, linux-wireless

On Mon, Dec 28, 2009 at 12:18 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2009-12-28 at 11:18 +0800, Zhu Yi wrote:
>> We start an one shot addba_resp_timer in ieee80211_start_tx_ba_session
>> but don't delete it in __ieee80211_stop_tx_ba_session. This will cause
>> problem in suspend and resume. When suspend happens without the timer
>> deleted, the timer handler will be called immediately after resume and
>> messes up driver status.
>>
>> See http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2134
>> comment #22 for more details.
>
> Hmm. The timer checks
>
>        if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) !=
>                                                HT_ADDBA_REQUESTED_MSK) {
>
> which /should/ make it a no-op in the case you mention because we tear
> down sessions, or does that not reset their state properly?
>
> Ok, so ___ieee80211_stop_tx_ba_session() doesn't, in fact, clear the
> mask right away, so I think we should add HT_AGG_STATE_REQ_STOP_BA_MSK
> to the code I quoted above?

When the patch addresses the above can you cc stable if applicable.

> In any case the del_timer_sync isn't right there and we also shouldn't
> really use it (per Linus)

Why is that?

  Luis

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-28 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-28  3:18 [PATCH] mac80211: delete addba_resp_timer when stop Tx BA session Zhu Yi
2009-12-28  8:18 ` Johannes Berg
2009-12-28 16:10   ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox