From patchwork Mon May 18 09:38:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 6427311 X-Patchwork-Delegate: kvalo@adurom.com 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 6E819C0432 for ; Mon, 18 May 2015 09:38:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 925D92060C for ; Mon, 18 May 2015 09:38:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A744B20499 for ; Mon, 18 May 2015 09:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753056AbbERJij (ORCPT ); Mon, 18 May 2015 05:38:39 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:34253 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752414AbbERJif (ORCPT ); Mon, 18 May 2015 05:38:35 -0400 Received: by wicmc15 with SMTP id mc15so84645246wic.1 for ; Mon, 18 May 2015 02:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WO8QryQZR5CBrfcA+syM5FKIBjyfR5Iwy0IN1x/xdLc=; b=zSXViTA8eexVjZ+LTiBNxzrTrwlg2wxysoVnQqqe/nBenQsAjksAOiYSPszjKb6M2d 1ESEppar/THsLXbBO6brjRTWfwiFBIyBe0vgs6b0RGSZ9WAJnd888K3UL6Ei+bKB1kHn qJZDi7MQOgRP/MqYlJqJ1J05Phd5stExqqhuo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WO8QryQZR5CBrfcA+syM5FKIBjyfR5Iwy0IN1x/xdLc=; b=DCxwHREL4xbuiMPoz/tMgKDUYU9hvh5edF+6LjudfaVN0E4J7Z6dqfqN66BAtszVbH QgkzvmYT/CnSMtgAaX8CUEqcbqeOpjzUwc9rwPncq9BZvbfN3Fp31wva53T6EsYmhyDe fc+d1aHJlfjLC1C20a26XK7xc5WLGovBYfH1iDxXTb4aGuOkvl5mmCLl8OJsUNoGim/z 5mSHzVEzah2AKiDSwWdPCeKg51VHN8Sz+b59J8XbAKc8SplOkZ1S2Q6cA1Q5nOOJZRzI +3B3wtecZ8ciGSq2Kjyjb+UNJrQjmqdyHa3PTrQdzQHkzsPne09JpTQT7ZmmsgqFAmwH HyFQ== X-Gm-Message-State: ALoCoQnfm9dn9ZtVC30SH7bkSXC/EpCst0694n6odU0ay9jBFewb2h3FPnRYsL+d4qBNyCJdvEhK5cOcSRoJy5e4xuk74y/TPMI6kZXSAYSU4ui0LwyZpHyzAfePzEBqx4rjuxRnwnXj X-Received: by 10.180.91.137 with SMTP id ce9mr19929495wib.76.1431941913980; Mon, 18 May 2015 02:38:33 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id it5sm11574426wid.3.2015.05.18.02.38.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 May 2015 02:38:33 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Janusz Dziedzic , Michal Kazior Subject: [PATCH v2 2/3] ath10k: fix idle power consumption Date: Mon, 18 May 2015 09:38:17 +0000 Message-Id: <1431941898-13591-3-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431941898-13591-1-git-send-email-michal.kazior@tieto.com> References: <1431076388-24800-1-git-send-email-michal.kazior@tieto.com> <1431941898-13591-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com 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=ham 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 From: Janusz Dziedzic mac80211 can update vif powersave state while disconnected. Firmware doesn't behave nicely and consumes more power than necessary if PS is disabled on a non-started vdev. Hence force-enable PS for non-running vdevs. This reduces power drain on QCA61X4 from 88mA to 36mA when interface is up and not associated. QCA988X wasn't measured. Signed-off-by: Janusz Dziedzic Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 425dbe271495..9f576ca99f86 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1735,7 +1735,14 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) enable_ps = false; } - if (enable_ps) { + if (!arvif->is_started) { + /* mac80211 can update vif powersave state while disconnected. + * Firmware doesn't behave nicely and consumes more power than + * necessary if PS is disabled on a non-started vdev. Hence + * force-enable PS for non-running vdevs. + */ + psmode = WMI_STA_PS_MODE_ENABLED; + } else if (enable_ps) { psmode = WMI_STA_PS_MODE_ENABLED; param = WMI_STA_PS_PARAM_INACTIVITY_TIME;