All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: check whether scan is in progress before queueing scan_work
Date: Fri, 09 Apr 2010 10:09:17 +0200	[thread overview]
Message-ID: <1270800557.3870.2.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1270544094-20980-1-git-send-email-ext-teemu.3.paasikivi@nokia.com>

On Tue, 2010-04-06 at 11:54 +0300, Teemu Paasikivi wrote:
> As scan_work is queued from work_work it needs to be checked if scan
> has been started during execution of work_work. Otherwise, when hw
> scan is used, the stack gets error about hw being busy with ongoing
> scan. This causes the stack to abort scan without notifying the driver
> about it. This leads to a situation where the hw is scanning and the stack
> thinks it's not. Then when the scan finishes, the stack will complain by
> warnings.

Actually, let's go with this patch. It should solve both Luis's and your
problem, and I just reviewed the locking -- currently scan_mtx and
work_mtx are completely independent.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

> Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
> ---
>  net/mac80211/work.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/net/mac80211/work.c b/net/mac80211/work.c
> index 1e1ea30..7bd8670 100644
> --- a/net/mac80211/work.c
> +++ b/net/mac80211/work.c
> @@ -919,11 +919,16 @@ static void ieee80211_work_work(struct work_struct *work)
>  		run_again(local, jiffies + HZ/2);
>  	}
>  
> -	if (list_empty(&local->work_list) && local->scan_req)
> +	mutex_lock(&local->scan_mtx);
> +
> +	if (list_empty(&local->work_list) && local->scan_req &&
> +	    !local->scanning)
>  		ieee80211_queue_delayed_work(&local->hw,
>  					     &local->scan_work,
>  					     round_jiffies_relative(0));
>  
> +	mutex_unlock(&local->scan_mtx);
> +
>  	mutex_unlock(&local->work_mtx);
>  
>  	ieee80211_recalc_idle(local);



  parent reply	other threads:[~2010-04-09  8:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06  8:54 [PATCH] mac80211: check whether scan is in progress before queueing scan_work Teemu Paasikivi
2010-04-06  9:06 ` Johannes Berg
2010-04-06  9:08   ` Johannes Berg
2010-04-06 10:16   ` Teemu Paasikivi
2010-04-06 10:27     ` Johannes Berg
2010-04-06 10:29       ` Johannes Berg
2010-04-06 11:05         ` Teemu Paasikivi
2010-04-06 16:23           ` Dan Williams
2010-04-06 17:17             ` Johannes Berg
2010-04-06 18:07               ` Dan Williams
2010-04-07  6:09         ` Teemu Paasikivi
2010-04-09  8:09 ` Johannes Berg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-04-09 10:07 Teemu Paasikivi

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=1270800557.3870.2.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ext-teemu.3.paasikivi@nokia.com \
    --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.