From patchwork Thu Feb 19 17:55:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5853391 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CA9179F36A for ; Thu, 19 Feb 2015 17:56:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FE55202C8 for ; Thu, 19 Feb 2015 17:56:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3948C202BE for ; Thu, 19 Feb 2015 17:56:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YOVKZ-0007G5-KB; Thu, 19 Feb 2015 17:56:07 +0000 Received: from sabertooth01.qualcomm.com ([65.197.215.72]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YOVKX-00079W-T6 for ath10k@lists.infradead.org; Thu, 19 Feb 2015 17:56:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1424368565; x=1455904565; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=FJZgC2T0PLQpToqJlgHZ7mUqleISfmOmixrNUv/b8/I=; b=N1CFbFfrKX5fX6HyD4vP44WZmG9PVDljcb5GqdA8Eh0pfdJlTseSf2DK au7fP6pR8toPUxgopIlson9lsMAEWQ5zoMQvfLjQm5qc3DPXfH92mntmJ qT7FmttOGV47xeBDje8Usxj/y4d3B2x/jjgohhodH/Zdl8OITcqaRLHET s=; X-IronPort-AV: E=McAfee;i="5600,1067,7717"; a="83508511" Received: from ironmsg03-l.qualcomm.com ([172.30.48.18]) by sabertooth01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Feb 2015 09:55:43 -0800 X-IronPort-AV: E=Sophos;i="5.09,609,1418112000"; d="scan'208";a="844097368" Received: from nasanexm02e.na.qualcomm.com ([129.46.53.254]) by Ironmsg03-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 19 Feb 2015 09:55:43 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by nasanexm02e.na.qualcomm.com (129.46.53.254) with Microsoft SMTP Server (TLS) id 15.0.995.29; Thu, 19 Feb 2015 09:55:42 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.995.29; Thu, 19 Feb 2015 09:55:32 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Thu, 19 Feb 2015 23:25:23 +0530 From: Rajkumar Manoharan To: Subject: [PATCH 2/2] ath10k: fix quiet duration configuration Date: Thu, 19 Feb 2015 23:25:06 +0530 Message-ID: <1424368506-18193-2-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1424368506-18193-1-git-send-email-rmanohar@qti.qualcomm.com> References: <1424368506-18193-1-git-send-email-rmanohar@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To aphydexm01b.ap.qualcomm.com (10.252.127.11) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150219_095605_995896_21DEC78C X-CRM114-Status: UNSURE ( 8.01 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.1 (-----) Cc: linux-wireless@vger.kernel.org, Rajkumar Manoharan X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/net/wireless/ath/ath10k/thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,