From patchwork Sun Mar 15 15:06:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 6013281 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 4F75E9F2A9 for ; Sun, 15 Mar 2015 15:07:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7324A20268 for ; Sun, 15 Mar 2015 15:07:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CCBB2024F for ; Sun, 15 Mar 2015 15:07:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752804AbbCOPHp (ORCPT ); Sun, 15 Mar 2015 11:07:45 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:40745 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752481AbbCOPHp (ORCPT ); Sun, 15 Mar 2015 11:07:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1426432065; x=1457968065; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=y4M7w0HxgSv/CO89yiWVezAh2OifeZf/Z+qLOtD4Gto=; b=WBb/gxjUG5KRFwUkxEmLKxYzHYa3VUMiUrLhzEjP4xJu0Wbwk4TJ1Ul9 zhZ5RY4ucKbyq0XZZxf9VuHtJZAxkLYfX9vWMWp3duU1nAhAnVGu4lZEL qjwsNWghHJzyCfIZf18TGzXcUtsvT7o5rFP2VLV9o3GXgnbmUBUgIErzm Y=; X-IronPort-AV: E=McAfee;i="5600,1067,7740"; a="108450506" Received: from ironmsg04-l.qualcomm.com ([172.30.48.19]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Mar 2015 08:07:44 -0700 X-IronPort-AV: E=Sophos;i="5.11,404,1422950400"; d="scan'208";a="837367502" Received: from nasanexm02f.na.qualcomm.com ([10.85.0.87]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 15 Mar 2015 08:07:44 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by nasanexm02f.na.qualcomm.com (10.85.0.87) with Microsoft SMTP Server (TLS) id 15.0.995.29; Sun, 15 Mar 2015 08:07:43 -0700 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; Sun, 15 Mar 2015 08:07:35 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Sun, 15 Mar 2015 20:37:26 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH 4/6] ath10k: do not restrict thermal throttling to ap mode Date: Sun, 15 Mar 2015 20:36:23 +0530 Message-ID: <1426431985-16332-5-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.3.2 In-Reply-To: <1426431985-16332-1-git-send-email-rmanohar@qti.qualcomm.com> References: <1426431985-16332-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) 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 Recently thermal mitigation is validated in station mode as well. Hence allowing thermal throttling for all interfaces. This enables user to validate thermal mitigation with different modes. Reported-by: Matthias Kaehlcke Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/thermal.c | 36 +------------------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c index 8640f41..604ea00 100644 --- a/drivers/net/wireless/ath/ath10k/thermal.c +++ b/drivers/net/wireless/ath/ath10k/thermal.c @@ -23,29 +23,6 @@ #include "debug.h" #include "wmi-ops.h" -static int ath10k_thermal_get_active_vifs(struct ath10k *ar, - enum wmi_vdev_type type) -{ - struct ath10k_vif *arvif; - int count = 0; - - lockdep_assert_held(&ar->conf_mutex); - - list_for_each_entry(arvif, &ar->arvifs, list) { - if (!arvif->is_started) - continue; - - if (!arvif->is_up) - continue; - - if (arvif->vdev_type != type) - continue; - - count++; - } - return count; -} - static int ath10k_thermal_get_max_throttle_state(struct thermal_cooling_device *cdev, unsigned long *state) @@ -73,7 +50,7 @@ ath10k_thermal_set_cur_throttle_state(struct thermal_cooling_device *cdev, unsigned long throttle_state) { struct ath10k *ar = cdev->devdata; - int num_bss, ret = 0; + int ret = 0; mutex_lock(&ar->conf_mutex); if (ar->state != ATH10K_STATE_ON) { @@ -87,17 +64,6 @@ ath10k_thermal_set_cur_throttle_state(struct thermal_cooling_device *cdev, ret = -EINVAL; goto out; } - /* TODO: Right now, thermal mitigation is handled only for single/multi - * vif AP mode. Since quiet param is not validated in STA mode, it needs - * to be investigated further to handle multi STA and multi-vif (AP+STA) - * mode properly. - */ - num_bss = ath10k_thermal_get_active_vifs(ar, WMI_VDEV_TYPE_AP); - if (!num_bss) { - ath10k_warn(ar, "no active AP interfaces\n"); - ret = -ENETDOWN; - goto out; - } ar->thermal.throttle_state = throttle_state; ath10k_thermal_set_throttling(ar); out: