linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Rajkumar Manoharan <rmanoharan@atheros.com>
Cc: Rajkumar Manoharan <Rajkumar.Manoharan@Atheros.com>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] mac80211: cancel scan_work in ieee80211_unregister_hw
Date: Fri, 13 May 2011 19:39:23 +0200	[thread overview]
Message-ID: <1305308363.3468.18.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <20110513171849.GA2760@vmraj-lnx.users.atheros.com>

On Fri, 2011-05-13 at 22:48 +0530, Rajkumar Manoharan wrote:

> These unneccesary driver calls has to be avoided. How about the following
> change to abort scan during scan loop.
> 
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index 4054399..9d18c43 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -384,11 +384,11 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
>         int i;
>         enum nl80211_channel_type orig_ct;
>  
> +       clear_bit(SDATA_STATE_RUNNING, &sdata->state);
> +
>         if (local->scan_sdata == sdata)
>                 ieee80211_scan_cancel(local);
>  
> -       clear_bit(SDATA_STATE_RUNNING, &sdata->state);
> -
>         /*
>          * Stop TX on this interface first.
>          */
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index ea44a8e..6353f93 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -719,6 +719,11 @@ void ieee80211_scan_work(struct work_struct *work)
>          * without scheduling a new work
>          */
>         do {
> +               if (!test_bit(SDATA_STATE_RUNNING, &sdata->state)) {
> +                       aborted = true;
> +                       goto out_complete;
> +               }
> +

Seems reasonable, but you should use ieee80211_sdata_running().

johannes


      reply	other threads:[~2011-05-13 17:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 17:09 [PATCH] mac80211: cancel scan_work in ieee80211_unregister_hw Rajkumar Manoharan
2011-05-12 17:25 ` Johannes Berg
2011-05-13  5:35   ` Rajkumar Manoharan
2011-05-13 10:53     ` Stanislaw Gruszka
2011-05-13 15:43     ` Johannes Berg
2011-05-13 17:18       ` Rajkumar Manoharan
2011-05-13 17:39         ` Johannes Berg [this message]

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=1305308363.3468.18.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=Rajkumar.Manoharan@Atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rmanoharan@atheros.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).