linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: "Guy, Wey-Yi" <wey-yi.w.guy@intel.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 1/2] iwlwifi: fix set_tx_power vs scan
Date: Thu, 14 Oct 2010 10:32:05 +0200	[thread overview]
Message-ID: <20101014083204.GA2286@redhat.com> (raw)
In-Reply-To: <1286983100.10446.1.camel@wwguy-ubuntu>

Hi Wey

On Wed, Oct 13, 2010 at 08:18:20AM -0700, Guy, Wey-Yi wrote:
> >  		IWL_WARN(priv,
> >  			 "Requested user TXPOWER %d below lower limit %d.\n",
> > @@ -1226,6 +1228,12 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
> >  		return -EINVAL;
> >  	}
> >  
> > +	if (test_bit(STATUS_SCANNING, &priv->status)) {
> > +		priv->tx_power_next = tx_power;
> > +		IWL_DEBUG_INFO(priv, "Deferring tx power set while scanning\n");
> > +		return 0;
> > +	}
> > +
[snip]
> >  	/* Since setting the TXPOWER may have been deferred while
> >  	 * performing the scan, fire one off */
> > -	iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
> > +	iwl_set_tx_power(priv, priv->tx_power_next, true);

Doh, this patch introduce a bug, when tx_power_next is not set (because
there was no scan during set_tx_power), but then when someone request
a scan and it finish, tx_power_next is written to hardware. I should
read tx_power using device sysfs not iwconfig when testing, will fix
that.

> Looks good, the only thing is if priv->tx_power_user_lmt ==
> priv->tx_power_next, we don't even have to call set_tx_power, but I
> guess calling it won't hurt, so its your decision check or not.

I'll will call iwl_set_tx_power( ... , false); what seems to be right
thing to do.

Stanislaw

  reply	other threads:[~2010-10-14  8:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13 13:39 [PATCH 1/2] iwlwifi: fix set_tx_power vs scan Stanislaw Gruszka
2010-10-13 13:39 ` [PATCH 2/2] iwlwifi: one less commit_rxon while scan Stanislaw Gruszka
2010-10-14  8:42   ` Stanislaw Gruszka
2010-10-14 15:54     ` Guy, Wey-Yi
2010-10-15 14:51       ` Stanislaw Gruszka
2010-10-15 16:00         ` Guy, Wey-Yi
2010-10-13 15:18 ` [PATCH 1/2] iwlwifi: fix set_tx_power vs scan Guy, Wey-Yi
2010-10-14  8:32   ` Stanislaw Gruszka [this message]
2010-10-21 13:13     ` Stanislaw Gruszka
2010-10-21 14:26       ` Guy, Wey-Yi
2010-10-22 12:56       ` Stanislaw Gruszka
2010-10-22 14:39         ` Guy, Wey-Yi
2010-10-22 15:04           ` Stanislaw Gruszka
2010-10-22 16:51         ` Dan Williams

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=20101014083204.GA2286@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.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 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).