All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211:  Clean up work-queues on disassociation.
Date: Wed, 20 Feb 2013 06:24:32 -0800	[thread overview]
Message-ID: <5124DCA0.6030106@candelatech.com> (raw)
In-Reply-To: <1361369637.8629.20.camel@jlt4.sipsolutions.net>

On 02/20/2013 06:13 AM, Johannes Berg wrote:
> On Wed, 2013-02-20 at 06:09 -0800, Ben Greear wrote:
>
>>>> @@ -2668,6 +2681,10 @@ static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata,
>>>>    			       false, frame_buf);
>>>>    	mutex_unlock(&ifmgd->mtx);
>>>>
>>>> +	/* Have to do this outside the ifmgd->mtx lock. */
>>>> +	cancel_work_sync(&ifmgd->monitor_work);
>>>> +	cancel_work_sync(&ifmgd->beacon_connection_loss_work);
>>>
>>> OTOH, you do this many many times, and that doesn't seem necessary...
>>>
>>> If the work structs run when we disconnected, that's ok, they just
>>> musn't run after we destroy the interface, so I think it'd be much
>>> better to just put the two lines into ieee80211_mgd_stop() instead of
>>> all the other places.
>>
>> Ok, that sounds promising to me.  For that matter, could we just call the sta_quiesce
>> method in mgd_stop?  It would be nice to have all of the final timer and work-queue cleanup
>> in a single place.
>
> That might be interesting, but I think we'd have to clear the
> timer_pending thing afterwards?

Are you talking about this code?

	if (del_timer_sync(&ifmgd->timer))
		set_bit(TMR_RUNNING_TIMER, &ifmgd->timers_running);

	if (del_timer_sync(&ifmgd->chswitch_timer))
		set_bit(TMR_RUNNING_CHANSW, &ifmgd->timers_running);

If so, maybe make a helper method that does all of the first part of the sta_quiesce()
logic, call that from both mgd_stop and the new sta_quiesce() method, and then have
sta_quiesce look like:

         sta_cleanup_timers_and_work();
         if (del_timer_sync(&ifmgd->timer))
		set_bit(TMR_RUNNING_TIMER, &ifmgd->timers_running);

	if (del_timer_sync(&ifmgd->chswitch_timer))
		set_bit(TMR_RUNNING_CHANSW, &ifmgd->timers_running);

?

>
>> And, maybe add some checks in the work-callback methods to bail early if the station
>> isn't connected?
>
> They already do :)

Ok, thanks.

Ben



-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  reply	other threads:[~2013-02-20 14:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20  2:11 [PATCH] mac80211: Clean up work-queues on disassociation greearb
2013-02-20  6:23 ` Julian Calaby
2013-02-20 14:04   ` Ben Greear
2013-02-20 22:08     ` Julian Calaby
2013-02-20  9:59 ` Johannes Berg
2013-02-20 14:09   ` Ben Greear
2013-02-20 14:13     ` Johannes Berg
2013-02-20 14:24       ` Ben Greear [this message]
2013-02-20 14:27         ` Johannes Berg
2013-02-25 10:20 ` Stanislaw Gruszka
2013-02-25 16:55   ` Ben Greear
2013-02-26 15:55     ` Stanislaw Gruszka
2013-02-26 16:51       ` Ben Greear

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=5124DCA0.6030106@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.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.