All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Florian Mickler <florian@mickler.org>
Cc: stable@kernel.org,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"Guy, Wey-Yi" <wey-yi.w.guy@intel.com>,
	"Chatre, Reinette" <reinette.chatre@intel.com>,
	Intel Linux Wireless <ilw@linux.intel.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	"Berg, Johannes" <johannes.berg@intel.com>,
	"Cahill, Ben M" <ben.m.cahill@intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iwl3945: queue the right work if the scan needs to be aborted
Date: Tue, 5 Oct 2010 12:43:58 +0200	[thread overview]
Message-ID: <20101005104357.GB18833@redhat.com> (raw)
In-Reply-To: <20101005121242.79cdafc2@schatten.dmk.lab>

On Tue, Oct 05, 2010 at 12:12:42PM +0200, Florian Mickler wrote:
> > 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
> 
> Thx for looking at this. I suspect you know the code better than I do.. what is about the
> first jump to :done in iwlagn_request_scan()
> 
>          if (!iwl_is_ready(priv)) {
>                  IWL_WARN(priv, "request scan called when driver not ready.\n");
>                  goto done;
>          }
> 
> Does abort_scan need to do anything in that case? 

Yes, because we do not return value to mac80211 about .hw_scan failure,
we always return 0, what is completely wrong. And yes, return error can
be done instead of queueing scan_completed to improve situation - this is
one of the thing, we do in wireless-testing.

> I can't see where we set up the hardware for scanning in that case.
> (I've gone through the codepath coming from the mac80211 hw_scan) 

.hw_scan = iwl_mac_hw_scan -> iwl_scan_initiate ->
 "priv->cfg->ops->utils->request_scan" = {iwl3945,iwlang}_request_scan

Stanislaw

WARNING: multiple messages have this Message-ID (diff)
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: [PATCH] iwl3945: queue the right work if the scan needs to be aborted
Date: Tue, 5 Oct 2010 12:43:58 +0200	[thread overview]
Message-ID: <20101005104357.GB18833@redhat.com> (raw)
In-Reply-To: <20101005121242.79cdafc2-mGsOIKOveelVRbCss4o9kg@public.gmane.org>

On Tue, Oct 05, 2010 at 12:12:42PM +0200, Florian Mickler wrote:
> > 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
> 
> Thx for looking at this. I suspect you know the code better than I do.. what is about the
> first jump to :done in iwlagn_request_scan()
> 
>          if (!iwl_is_ready(priv)) {
>                  IWL_WARN(priv, "request scan called when driver not ready.\n");
>                  goto done;
>          }
> 
> Does abort_scan need to do anything in that case? 

Yes, because we do not return value to mac80211 about .hw_scan failure,
we always return 0, what is completely wrong. And yes, return error can
be done instead of queueing scan_completed to improve situation - this is
one of the thing, we do in wireless-testing.

> I can't see where we set up the hardware for scanning in that case.
> (I've gone through the codepath coming from the mac80211 hw_scan) 

.hw_scan = iwl_mac_hw_scan -> iwl_scan_initiate ->
 "priv->cfg->ops->utils->request_scan" = {iwl3945,iwlang}_request_scan

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

  reply	other threads:[~2010-10-05 10:47 UTC|newest]

Thread overview: 29+ 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
2010-10-05  6:43 ` Florian Mickler
2010-10-05  8:57 ` Stanislaw Gruszka
2010-10-05  8:57   ` Stanislaw Gruszka
2010-10-05 10:12   ` Florian Mickler
2010-10-05 10:43     ` Stanislaw Gruszka [this message]
2010-10-05 10:43       ` Stanislaw Gruszka
2010-10-05 22:29       ` Florian Mickler
2010-10-05 22:29         ` Florian Mickler
2010-10-05 22:21   ` [PATCH] iwlwifi: fix iwlwifi scanning corner cases Florian Mickler
2010-10-05 22:21     ` Florian Mickler
2010-10-06  9:02     ` Stanislaw Gruszka
2010-10-06  9:02       ` Stanislaw Gruszka
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:04         ` Stanislaw Gruszka
2010-10-06 16:12         ` Guy, Wey-Yi
2010-10-06 17:32           ` Florian Mickler
2010-10-06 17:45         ` Florian Mickler
2010-10-06 17:45           ` Florian Mickler
2010-10-06 17:48           ` Guy, Wey-Yi
2010-10-06 20:01         ` John W. Linville
2010-10-06 20:01           ` John W. Linville
  -- strict thread matches above, loose matches on Subject: below --
2010-09-24 16:22 [PATCH] iwl3945: queue the right work if the scan needs to be aborted Florian Mickler
2010-09-24 16:22 ` Florian Mickler
2010-09-24 19:51 ` Guy, Wey-Yi
2010-09-27  6:13   ` Florian Mickler
2010-09-27  6:13     ` Florian Mickler
2010-09-27 19:59     ` Guy, Wey-Yi W
2010-09-27 20:11 ` Guy, Wey-Yi

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=20101005104357.GB18833@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=ben.m.cahill@intel.com \
    --cc=florian@mickler.org \
    --cc=ilw@linux.intel.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=stable@kernel.org \
    --cc=wey-yi.w.guy@intel.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.