diff mbox

[2/2] ath10k: fix quiet duration configuration

Message ID 1424368506-18193-2-git-send-email-rmanohar@qti.qualcomm.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Rajkumar Manoharan Feb. 19, 2015, 5:55 p.m. UTC
Duty cycle is nothing but percentage of one period in which a
signal is active. But it is wrongly interpreted as ratio of quiet
duration. So fix the quiet duration to the remaining percentage
of duty cycle (active ratio).

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rajkumar Manoharan March 6, 2015, 7:39 a.m. UTC | #1
On Thu, Feb 19, 2015 at 11:25:06PM +0530, Rajkumar Manoharan wrote:
> Duty cycle is nothing but percentage of one period in which a
> signal is active. But it is wrongly interpreted as ratio of quiet
> duration. So fix the quiet duration to the remaining percentage
> of duty cycle (active ratio).
> 
> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
> ---
Kalle,

Please drop this change as it breaks the user space interface. Will send
updated patch ASAP. Sorry for the inconvenience.

-Rajkumar
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c
index aede750..0d89ab5 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -98,7 +98,7 @@  static int ath10k_thermal_set_cur_dutycycle(struct thermal_cooling_device *cdev,
 	}
 	period = max(ATH10K_QUIET_PERIOD_MIN,
 		     (ATH10K_QUIET_PERIOD_DEFAULT / num_bss));
-	duration = (period * duty_cycle) / 100;
+	duration = (period * (100 - duty_cycle)) / 100;
 	enabled = duration ? 1 : 0;
 
 	ret = ath10k_wmi_pdev_set_quiet_mode(ar, period, duration,