netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Florian Mickler <florian-sVu6HhrpSfRAfugRpC6u6w@public.gmane.org>
Cc: stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	"linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Guy,
	Wey-Yi" <wey-yi.w.guy-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Chatre,
	Reinette"
	<reinette.chatre-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Intel Linux Wireless
	<ilw-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	"John W. Linville"
	<linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>,
	"Berg,
	Johannes" <johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Cahill,
	Ben M" <ben.m.cahill-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Fw: [PATCH] iwl3945: queue the right work if the scan needs to be aborted
Date: Tue, 5 Oct 2010 10:57:17 +0200	[thread overview]
Message-ID: <20101005085717.GA18012@redhat.com> (raw)
In-Reply-To: <20101005084305.52a31ed4-mGsOIKOveelVRbCss4o9kg@public.gmane.org>

On Tue, Oct 05, 2010 at 08:43:05AM +0200, Florian Mickler wrote:
> commit e7ee762cf074b0fd8eec483d0cef8fdbf0d04b81
> 
> 
> Begin forwarded message:
> On Fri, 2010-09-24 at 09:22 -0700, Florian Mickler wrote:
> > iwl3945's scan_completed calls into the mac80211 stack which triggers a
> > warn on if there is no scan outstanding.
> > 
> > This can be avoided by not calling scan_completed but abort_scan in
> > iwl3945_request_scan  in the done: branch of the function which is used
> > as an error out.
> > 
> > The done: branch seems to be an error-out branch, as, for example, if
> > iwl_is_ready(priv) returns false  the done: branch is executed.
> > 
> > NOTE:
> > I'm not familiar with the driver at all.
> > I just quickly scanned as a reaction to
> > 
> > https://bugzilla.kernel.org/show_bug.cgi?id=17722
> > 
> > the users of scan_completed in the  iwl3945 driver and noted the odd
> > discrepancy between the comment above this instance and the comment in
> > mac80211 scan_completed function.
> > Signed-off-by: Florian Mickler <florian-sVu6HhrpSfRAfugRpC6u6w@public.gmane.org>
> Acked-by: Wey-Yi Guy <wey-yi.w.guy-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > ---
> go into wireless-2.6 and stable only, scan fix already in
> wireless-next-2.6

> 
> Thanks
> Wey
> 
> >  drivers/net/wireless/iwlwifi/iwl-agn-lib.c  |    2 +-
> >  drivers/net/wireless/iwlwifi/iwl3945-base.c |    2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> > index 9dd9e64..8fd00a6 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> > @@ -1411,7 +1411,7 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
> >  	clear_bit(STATUS_SCAN_HW, &priv->status);
> >  	clear_bit(STATUS_SCANNING, &priv->status);
> >  	/* inform mac80211 scan aborted */
> > -	queue_work(priv->workqueue, &priv->scan_completed);
> > +	queue_work(priv->workqueue, &priv->abort_scan);

Unfortunately this patch is not right thing to do. If you look at
abort_scan work, it do nothing if STATUS_SCAN_ABORTING bit is not set.
That's wrong because we have to complete scan (with abort == true).
If STATUS_SCAN_ABORTING will be set, abort_work will send scan cancel
commands to hardware what is wrong if scan was not started yet.

What we can eventually do, except apply iwl-scan rewrite from
wireless-testing, is something like that:
 
iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)

  clear_bit(STATUS_SCAN_HW, &priv->status); 
  clear_bit(STATUS_SCANNING, &priv->status); 
  /* inform mac80211 scan aborted */ 
  set_bit(STATUS_SCAN_ABORTING, &priv->status);
  queue_work(priv->workqueue, &priv->scan_completed);

ieee80211_scan_completed
  
  if (!internal) {
     bool aborted = test_bit(STATUS_SCAN_ABORTING, &priv->status);
     ieee80211_scan_completed(priv->hw, aborted);

  }

However, I do not think we should go with that to -stable (below
2.6.36). IIRC warnings showed up in current 2.6.36-rc, because of
some other changes in the code.

Stanislaw
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-10-05  8:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05  6:43 Fw: [PATCH] iwl3945: queue the right work if the scan needs to be aborted Florian Mickler
     [not found] ` <20101005084305.52a31ed4-mGsOIKOveelVRbCss4o9kg@public.gmane.org>
2010-10-05  8:57   ` Stanislaw Gruszka [this message]
2010-10-05 10:12     ` Florian Mickler
     [not found]       ` <20101005121242.79cdafc2-mGsOIKOveelVRbCss4o9kg@public.gmane.org>
2010-10-05 10:43         ` Stanislaw Gruszka
     [not found]           ` <20101005104357.GB18833-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-10-05 22:29             ` Florian Mickler
     [not found]     ` <20101005085717.GA18012-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-10-05 22:21       ` [PATCH] iwlwifi: fix iwlwifi scanning corner cases Florian Mickler
     [not found]         ` <1286317292-10679-1-git-send-email-florian-sVu6HhrpSfRAfugRpC6u6w@public.gmane.org>
2010-10-06  9:02           ` Stanislaw Gruszka
     [not found]             ` <20101006090228.GA2523-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-10-06 16:04               ` [PATCH wireless-2.6 or stable] iwlwifi: return error when fail to start scanning Stanislaw Gruszka
2010-10-06 16:12                 ` Guy, Wey-Yi
2010-10-06 17:32                   ` Florian Mickler
     [not found]                 ` <20101006160434.GB24581-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-10-06 17:45                   ` Florian Mickler
2010-10-06 17:48                     ` Guy, Wey-Yi
2010-10-06 20:01                   ` John W. Linville

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=20101005085717.GA18012@redhat.com \
    --to=sgruszka-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=ben.m.cahill-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=florian-sVu6HhrpSfRAfugRpC6u6w@public.gmane.org \
    --cc=ilw-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=reinette.chatre-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=wey-yi.w.guy-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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 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).