linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath5k: ignore the return value of ath5k_hw_noise_floor_calibration
@ 2008-11-03 10:27 Felix Fietkau
  2008-11-03 19:27 ` Tim Gardner
  0 siblings, 1 reply; 6+ messages in thread
From: Felix Fietkau @ 2008-11-03 10:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville, Nick Kossifidis

Noise floor calibration occasionally fails on Atheros hardware.
This is not fatal and can happen if there's simply too much 
noise on the air. Ignoring the calibration error is the right
thing to do here, because when the error is ignored, the hardware
will still work, whereas if the error causes the driver to bail out
of a bigger configuration function and does not configure the tx
queues or the IMR (as is the case in reset.c), the hw no longer
works properly until the next reset.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c
--- a/drivers/net/wireless/ath5k/phy.c
+++ b/drivers/net/wireless/ath5k/phy.c
@@ -2196,9 +2196,7 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah,
 		return ret;
 	}
 
-	ret = ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
-	if (ret)
-		return ret;
+	ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
 
 	/*
 	 * Re-enable RX/TX and beacons
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c
--- a/drivers/net/wireless/ath5k/reset.c
+++ b/drivers/net/wireless/ath5k/reset.c
@@ -842,9 +842,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
 	 *
 	 * XXX: Find an interval that's OK for all cards...
 	 */
-	ret = ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
-	if (ret)
-		return ret;
+	ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
 
 	/*
 	 * Reset queues and start beacon timers at the end of the reset routine

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath5k: ignore the return value of ath5k_hw_noise_floor_calibration
  2008-11-03 10:27 Felix Fietkau
@ 2008-11-03 19:27 ` Tim Gardner
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Gardner @ 2008-11-03 19:27 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, John W. Linville, Nick Kossifidis

Felix Fietkau wrote:
> Noise floor calibration occasionally fails on Atheros hardware.
> This is not fatal and can happen if there's simply too much 
> noise on the air. Ignoring the calibration error is the right
> thing to do here, because when the error is ignored, the hardware
> will still work, whereas if the error causes the driver to bail out
> of a bigger configuration function and does not configure the tx
> queues or the IMR (as is the case in reset.c), the hw no longer
> works properly until the next reset.
> 
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> 
> diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c
> --- a/drivers/net/wireless/ath5k/phy.c
> +++ b/drivers/net/wireless/ath5k/phy.c
> @@ -2196,9 +2196,7 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah,
>  		return ret;
>  	}
>  
> -	ret = ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
> -	if (ret)
> -		return ret;
> +	ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
>  
>  	/*
>  	 * Re-enable RX/TX and beacons
> diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c
> --- a/drivers/net/wireless/ath5k/reset.c
> +++ b/drivers/net/wireless/ath5k/reset.c
> @@ -842,9 +842,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
>  	 *
>  	 * XXX: Find an interval that's OK for all cards...
>  	 */
> -	ret = ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
> -	if (ret)
> -		return ret;
> +	ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
>  
>  	/*
>  	 * Reset queues and start beacon timers at the end of the reset routine
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

ACK

While I'm not sure I agree with your theory on why noise floor
calibration fails, this patch certainly cuts down on log noise without
introducing any adverse side effects.

rtg
-- 
Tim Gardner timg@tpi.com www.tpi.com
OR 503-601-0234 x102 MT 406-443-5357

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] ath5k: ignore the return value of ath5k_hw_noise_floor_calibration
@ 2009-01-10  1:21 darklight
  2009-01-10 23:15 ` Bob Copeland
  2009-01-13 19:43 ` John W. Linville
  0 siblings, 2 replies; 6+ messages in thread
From: darklight @ 2009-01-10  1:21 UTC (permalink / raw)
  To: linux-wireless

hi,

some weeks ago Felix Fietkau posted a patch for the "ath5k phy0:
unsupported jumbo" warnings (see here:
http://article.gmane.org/gmane.linux.kernel.wireless.general/23430 )
I just had the same problem - after applying Felix' patch the warnings
went down from 50-100 per day to 5.

as a quick note: I did not just apply this patch, instead I replaced
Linus' upstream wireless stack with the one from wireless-testing
(using kernel version 2.6.28)

I hope Felix' patch can get into Linus' kernel (mainline) so other
users can profit from this

oh and just to make sure this patch will get accepted:
ath5k_hw_noise_floor_calibration was called without verifying it's
result in ath5k_hw_rf511x_calibrate -> so in theory this patch is
clean an get into mainline (just to be fair: I must admit I'm not
familiar with the mac80211 nor with ath5k code)

regards,
Martin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath5k: ignore the return value of ath5k_hw_noise_floor_calibration
  2009-01-10  1:21 [PATCH] ath5k: ignore the return value of ath5k_hw_noise_floor_calibration darklight
@ 2009-01-10 23:15 ` Bob Copeland
  2009-01-15 18:49   ` [stable] " Greg KH
  2009-01-13 19:43 ` John W. Linville
  1 sibling, 1 reply; 6+ messages in thread
From: Bob Copeland @ 2009-01-10 23:15 UTC (permalink / raw)
  To: darklight; +Cc: linux-wireless, stable

On Fri, Jan 9, 2009 at 8:21 PM, darklight
<darklight.xdarklight@googlemail.com> wrote:
> hi,
>
> some weeks ago Felix Fietkau posted a patch for the "ath5k phy0:
> unsupported jumbo" warnings (see here:
> http://article.gmane.org/gmane.linux.kernel.wireless.general/23430 )
> I just had the same problem - after applying Felix' patch the warnings
> went down from 50-100 per day to 5.

It's already in Linus' tree for 2.6.29 (CCed stable@kernel.org).

Greg / stable, can you take 8b0162a3dc5c30e862b7a73da29e32de3170f5e4 for
2.6.28.X?

(It's not unsupported jumbo warnings, it's for noise floor calibration
failures, as in the subject of this email.)

-- 
Bob Copeland %% www.bobcopeland.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath5k: ignore the return value of ath5k_hw_noise_floor_calibration
  2009-01-10  1:21 [PATCH] ath5k: ignore the return value of ath5k_hw_noise_floor_calibration darklight
  2009-01-10 23:15 ` Bob Copeland
@ 2009-01-13 19:43 ` John W. Linville
  1 sibling, 0 replies; 6+ messages in thread
From: John W. Linville @ 2009-01-13 19:43 UTC (permalink / raw)
  To: darklight; +Cc: linux-wireless

On Sat, Jan 10, 2009 at 02:21:44AM +0100, darklight wrote:
> hi,
> 
> some weeks ago Felix Fietkau posted a patch for the "ath5k phy0:
> unsupported jumbo" warnings (see here:
> http://article.gmane.org/gmane.linux.kernel.wireless.general/23430 )
> I just had the same problem - after applying Felix' patch the warnings
> went down from 50-100 per day to 5.
> 
> as a quick note: I did not just apply this patch, instead I replaced
> Linus' upstream wireless stack with the one from wireless-testing
> (using kernel version 2.6.28)
> 
> I hope Felix' patch can get into Linus' kernel (mainline) so other
> users can profit from this

It is in Linus' kernel right now:

commit 8b0162a3dc5c30e862b7a73da29e32de3170f5e4
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Mon Nov 3 11:27:38 2008 +0100

    ath5k: ignore the return value of ath5k_hw_noise_floor_calibration

    Noise floor calibration occasionally fails on Atheros hardware.
    This is not fatal and can happen if there's simply too much
    noise on the air. Ignoring the calibration error is the right
    thing to do here, because when the error is ignored, the hardware
    will still work, whereas if the error causes the driver to bail out
    of a bigger configuration function and does not configure the tx
    queues or the IMR (as is the case in reset.c), the hw no longer
    works properly until the next reset.

    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

Hth!

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable] [PATCH] ath5k: ignore the return value of ath5k_hw_noise_floor_calibration
  2009-01-10 23:15 ` Bob Copeland
@ 2009-01-15 18:49   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2009-01-15 18:49 UTC (permalink / raw)
  To: Bob Copeland; +Cc: darklight, linux-wireless, stable

On Sat, Jan 10, 2009 at 06:15:01PM -0500, Bob Copeland wrote:
> On Fri, Jan 9, 2009 at 8:21 PM, darklight
> <darklight.xdarklight@googlemail.com> wrote:
> > hi,
> >
> > some weeks ago Felix Fietkau posted a patch for the "ath5k phy0:
> > unsupported jumbo" warnings (see here:
> > http://article.gmane.org/gmane.linux.kernel.wireless.general/23430 )
> > I just had the same problem - after applying Felix' patch the warnings
> > went down from 50-100 per day to 5.
> 
> It's already in Linus' tree for 2.6.29 (CCed stable@kernel.org).
> 
> Greg / stable, can you take 8b0162a3dc5c30e862b7a73da29e32de3170f5e4 for
> 2.6.28.X?
> 
> (It's not unsupported jumbo warnings, it's for noise floor calibration
> failures, as in the subject of this email.)

Now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-01-15 19:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-10  1:21 [PATCH] ath5k: ignore the return value of ath5k_hw_noise_floor_calibration darklight
2009-01-10 23:15 ` Bob Copeland
2009-01-15 18:49   ` [stable] " Greg KH
2009-01-13 19:43 ` John W. Linville
  -- strict thread matches above, loose matches on Subject: below --
2008-11-03 10:27 Felix Fietkau
2008-11-03 19:27 ` Tim Gardner

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).