From: Michael Buesch <mb@bu3sch.de>
To: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
johannes@sipsolutions.net
Subject: Re: [PATCH] mac80211: flush workqueue before calling driver ->stop() method
Date: Sun, 10 Jan 2010 14:35:24 +0100 [thread overview]
Message-ID: <201001101435.26235.mb@bu3sch.de> (raw)
In-Reply-To: <20100110130752.GG1735@mail.wantstofly.org>
On Sunday 10 January 2010 14:07:53 Lennert Buytenhek wrote:
> Since commit "mwl8k: handle station database update for AP's sta entry
> via ->sta_notify()", mwl8k every now and then gets a command timeout
> when ifconfig'ing a STA interface down. This turns out to be due to
> mwl8k_stop() being called while the work queue item that was scheduled
> by mwl8k_sta_notify() to remove the STA entry for the associated AP is
> still queued, and the former disables interrupts so that when the
> latter eventually runs, a command completion interrupt is never seen.
>
> Fix this by changing ieee80211_stop_device() so that the workqueue is
> flushed before drv_stop() is called, instead of doing it the other way
> around as is done now. (As ->stop() is allowed to sleep, there isn't
> any reason for drivers to queue work from within it.)
This smells like we should either:
o Add an assertion that checks whether the driver queued work although it was forbidden.
or
o Call flush_workqueue twice. Once before and once after drv_stop.
> Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
>
> diff --git a/net/mac80211/util.c b/net/mac80211/util.c
> index bc73904..04680ca 100644
> --- a/net/mac80211/util.c
> +++ b/net/mac80211/util.c
> @@ -1077,9 +1077,9 @@ void ieee80211_stop_device(struct ieee80211_local *local)
> ieee80211_led_radio(local, false);
>
> cancel_work_sync(&local->reconfig_filter);
> - drv_stop(local);
>
> flush_workqueue(local->workqueue);
> + drv_stop(local);
> }
>
> int ieee80211_reconfig(struct ieee80211_local *local)
--
Greetings, Michael.
next prev parent reply other threads:[~2010-01-10 13:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-10 13:07 [PATCH] mac80211: flush workqueue before calling driver ->stop() method Lennert Buytenhek
2010-01-10 13:35 ` Michael Buesch [this message]
2010-01-10 13:40 ` Johannes Berg
2010-01-10 13:43 ` Michael Buesch
2010-01-10 13:45 ` Johannes Berg
2010-01-10 13:50 ` Michael Buesch
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=201001101435.26235.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=buytenh@wantstofly.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/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.