From patchwork Tue Jan 13 09:22:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5618501 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 67194C058D for ; Tue, 13 Jan 2015 09:22:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A77D204FB for ; Tue, 13 Jan 2015 09:22:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61B89204C9 for ; Tue, 13 Jan 2015 09:22:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751040AbbAMJWi (ORCPT ); Tue, 13 Jan 2015 04:22:38 -0500 Received: from sabertooth01.qualcomm.com ([65.197.215.72]:54228 "EHLO sabertooth01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbbAMJWg (ORCPT ); Tue, 13 Jan 2015 04:22:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1421140957; x=1452676957; h=from:to:cc:subject:date:message-id:mime-version; bh=rsoCCgEToAvz7HCw+XO/bqSPFsOmhfbpI3TkveWKkIk=; b=GiLENher1Nvpiatop/bX/KkFrs8JgxiZYJBFM8pfg7rmSjkiK6pejtAF vWXX39E9/NvWCr+2ICRO2SKouM1LmDDHziUt0gKDhrEBtSm325Puj8RfF HT01NNqWKbZWZbvb26PnfZw4nWpzq00b9Dge4WWEjZ8y0WdO5Q71ac2x5 k=; X-IronPort-AV: E=McAfee;i="5600,1067,7679"; a="81431746" Received: from ironmsg04-l.qualcomm.com ([172.30.48.19]) by sabertooth01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Jan 2015 01:22:36 -0800 X-IronPort-AV: E=Sophos;i="5.07,748,1413270000"; d="scan'208";a="790774068" Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 13 Jan 2015 01:22:35 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.222.112.203) by nasanexhc08.na.qualcomm.com (172.30.39.7) with Microsoft SMTP Server (TLS) id 14.3.181.6; Tue, 13 Jan 2015 01:22:35 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.222.112.203) with Microsoft SMTP Server (TLS) id 15.0.995.29; Tue, 13 Jan 2015 01:22:27 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Tue, 13 Jan 2015 14:52:18 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH] ath10k: fix duration calculation for quiet param Date: Tue, 13 Jan 2015 14:52:14 +0530 Message-ID: <1421140934-16109-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.2.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01b.ap.qualcomm.com (10.222.112.203) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 The duty cycle (% of quiet duration) is used to put the device in quiet mode for the given period. Currently the quiet duration is wrongly calculated which results in not enabling quiet mode. Fix the calculation as below duration = (period * duty cycle) / 100 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 edecc6c..aede750 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 * duty_cycle) / 100; enabled = duration ? 1 : 0; ret = ath10k_wmi_pdev_set_quiet_mode(ar, period, duration,