* [PATCH] ath9k_htc: do ani shortcalibratio if we got -ETIMEDOUT
[not found] <20150811214324.GA30816@mwanda>
@ 2015-08-13 18:21 ` Oleksij Rempel
2015-08-14 5:10 ` [ath9k-devel] " Oleksij Rempel
0 siblings, 1 reply; 4+ messages in thread
From: Oleksij Rempel @ 2015-08-13 18:21 UTC (permalink / raw)
To: ath9k-devel, dan.carpenter, Sujith.Manoharan, kvalo,
linux-wireless
Cc: Oleksij Rempel
From: Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com>
current code will handle -ETIMEDOUT as success which is probalbly wrong.
According to this comment I assume it is safe to handle -ETIMEDOUT as false:
drivers/net/wireless/ath/ath9k/calib.c
290 /*
291 * We timed out waiting for the noisefloor to load, probably due to an
292 * in-progress rx. Simply return here and allow the load plenty of time
293 * to complete before the next calibration interval. We need to avoid
294 * trying to load -50 (which happens below) while the previous load is
295 * still in progress as this can cause rx deafness. Instead by returning
296 * here, the baseband nf cal will just be capped by our present
297 * noisefloor until the next calibration timer.
298 */
Since no other error wariants are present, this patch is checking only
for (ret <= 0).
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index dab1323..172a9ff 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -794,8 +794,11 @@ void ath9k_htc_ani_work(struct work_struct *work)
common->ani.longcal_timer = timestamp;
}
- /* Short calibration applies only while caldone is false */
- if (!common->ani.caldone) {
+ /*
+ * Short calibration applies only while caldone
+ * is false or -ETIMEDOUT
+ */
+ if (common->ani.caldone <= 0) {
if ((timestamp - common->ani.shortcal_timer) >=
short_cal_interval) {
shortcal = true;
@@ -844,7 +847,11 @@ set_timer:
*/
cal_interval = ATH_LONG_CALINTERVAL;
cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL);
- if (!common->ani.caldone)
+ /*
+ * Short calibration applies only while caldone
+ * is false or -ETIMEDOUT
+ */
+ if (common->ani.caldone <= 0)
cal_interval = min(cal_interval, (u32)short_cal_interval);
ieee80211_queue_delayed_work(common->hw, &priv->ani_work,
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [ath9k-devel] [PATCH] ath9k_htc: do ani shortcalibratio if we got -ETIMEDOUT
2015-08-13 18:21 ` [PATCH] ath9k_htc: do ani shortcalibratio if we got -ETIMEDOUT Oleksij Rempel
@ 2015-08-14 5:10 ` Oleksij Rempel
2015-08-14 5:16 ` [PATCH v2] " Oleksij Rempel
0 siblings, 1 reply; 4+ messages in thread
From: Oleksij Rempel @ 2015-08-14 5:10 UTC (permalink / raw)
To: ath9k-devel, dan.carpenter, Sujith.Manoharan, kvalo,
linux-wireless
Cc: Oleksij Rempel
[-- Attachment #1: Type: text/plain, Size: 2558 bytes --]
Opps wrong email address. I'll resend the patch
Am 13.08.2015 um 20:21 schrieb Oleksij Rempel:
> From: Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com>
>
> current code will handle -ETIMEDOUT as success which is probalbly wrong.
>
> According to this comment I assume it is safe to handle -ETIMEDOUT as false:
> drivers/net/wireless/ath/ath9k/calib.c
> 290 /*
> 291 * We timed out waiting for the noisefloor to load, probably due to an
> 292 * in-progress rx. Simply return here and allow the load plenty of time
> 293 * to complete before the next calibration interval. We need to avoid
> 294 * trying to load -50 (which happens below) while the previous load is
> 295 * still in progress as this can cause rx deafness. Instead by returning
> 296 * here, the baseband nf cal will just be capped by our present
> 297 * noisefloor until the next calibration timer.
> 298 */
>
> Since no other error wariants are present, this patch is checking only
> for (ret <= 0).
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Oleksij Rempel <external.Oleksij.Rempel@de.bosch.com>
> ---
> drivers/net/wireless/ath/ath9k/htc_drv_main.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
> index dab1323..172a9ff 100644
> --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
> @@ -794,8 +794,11 @@ void ath9k_htc_ani_work(struct work_struct *work)
> common->ani.longcal_timer = timestamp;
> }
>
> - /* Short calibration applies only while caldone is false */
> - if (!common->ani.caldone) {
> + /*
> + * Short calibration applies only while caldone
> + * is false or -ETIMEDOUT
> + */
> + if (common->ani.caldone <= 0) {
> if ((timestamp - common->ani.shortcal_timer) >=
> short_cal_interval) {
> shortcal = true;
> @@ -844,7 +847,11 @@ set_timer:
> */
> cal_interval = ATH_LONG_CALINTERVAL;
> cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL);
> - if (!common->ani.caldone)
> + /*
> + * Short calibration applies only while caldone
> + * is false or -ETIMEDOUT
> + */
> + if (common->ani.caldone <= 0)
> cal_interval = min(cal_interval, (u32)short_cal_interval);
>
> ieee80211_queue_delayed_work(common->hw, &priv->ani_work,
>
--
Regards,
Oleksij
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] ath9k_htc: do ani shortcalibratio if we got -ETIMEDOUT
2015-08-14 5:10 ` [ath9k-devel] " Oleksij Rempel
@ 2015-08-14 5:16 ` Oleksij Rempel
2015-08-25 12:10 ` [v2] " Kalle Valo
0 siblings, 1 reply; 4+ messages in thread
From: Oleksij Rempel @ 2015-08-14 5:16 UTC (permalink / raw)
To: ath9k-devel, kvalo, linux-wireless; +Cc: Oleksij Rempel
current code will handle -ETIMEDOUT as success which is probalbly wrong.
According to this comment I assume it is safe to handle -ETIMEDOUT as false:
drivers/net/wireless/ath/ath9k/calib.c
290 /*
291 * We timed out waiting for the noisefloor to load, probably due to an
292 * in-progress rx. Simply return here and allow the load plenty of time
293 * to complete before the next calibration interval. We need to avoid
294 * trying to load -50 (which happens below) while the previous load is
295 * still in progress as this can cause rx deafness. Instead by returning
296 * here, the baseband nf cal will just be capped by our present
297 * noisefloor until the next calibration timer.
298 */
Since no other error wariants are present, this patch is checking only
for (ret <= 0).
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index dab1323..172a9ff 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -794,8 +794,11 @@ void ath9k_htc_ani_work(struct work_struct *work)
common->ani.longcal_timer = timestamp;
}
- /* Short calibration applies only while caldone is false */
- if (!common->ani.caldone) {
+ /*
+ * Short calibration applies only while caldone
+ * is false or -ETIMEDOUT
+ */
+ if (common->ani.caldone <= 0) {
if ((timestamp - common->ani.shortcal_timer) >=
short_cal_interval) {
shortcal = true;
@@ -844,7 +847,11 @@ set_timer:
*/
cal_interval = ATH_LONG_CALINTERVAL;
cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL);
- if (!common->ani.caldone)
+ /*
+ * Short calibration applies only while caldone
+ * is false or -ETIMEDOUT
+ */
+ if (common->ani.caldone <= 0)
cal_interval = min(cal_interval, (u32)short_cal_interval);
ieee80211_queue_delayed_work(common->hw, &priv->ani_work,
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [v2] ath9k_htc: do ani shortcalibratio if we got -ETIMEDOUT
2015-08-14 5:16 ` [PATCH v2] " Oleksij Rempel
@ 2015-08-25 12:10 ` Kalle Valo
0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2015-08-25 12:10 UTC (permalink / raw)
To: Oleksij Rempel; +Cc: ath9k-devel, linux-wireless, Oleksij Rempel
> current code will handle -ETIMEDOUT as success which is probalbly wrong.
>
> According to this comment I assume it is safe to handle -ETIMEDOUT as false:
> drivers/net/wireless/ath/ath9k/calib.c
> 290 /*
> 291 * We timed out waiting for the noisefloor to load, probably due to an
> 292 * in-progress rx. Simply return here and allow the load plenty of time
> 293 * to complete before the next calibration interval. We need to avoid
> 294 * trying to load -50 (which happens below) while the previous load is
> 295 * still in progress as this can cause rx deafness. Instead by returning
> 296 * here, the baseband nf cal will just be capped by our present
> 297 * noisefloor until the next calibration timer.
> 298 */
>
> Since no other error wariants are present, this patch is checking only
> for (ret <= 0).
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-25 12:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20150811214324.GA30816@mwanda>
2015-08-13 18:21 ` [PATCH] ath9k_htc: do ani shortcalibratio if we got -ETIMEDOUT Oleksij Rempel
2015-08-14 5:10 ` [ath9k-devel] " Oleksij Rempel
2015-08-14 5:16 ` [PATCH v2] " Oleksij Rempel
2015-08-25 12:10 ` [v2] " Kalle Valo
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).