From patchwork Wed Nov 14 02:50:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 10681881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12B9E109C for ; Wed, 14 Nov 2018 02:51:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 086032B2C1 for ; Wed, 14 Nov 2018 02:51:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F02C12B2DE; Wed, 14 Nov 2018 02:51:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7B3882B2C1 for ; Wed, 14 Nov 2018 02:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=KbjtBxbmgAwz40WsrP52xd6sAEswSiwg02FD17Ok1/U=; b=KtC m89uH/7JsXlc8V5u3aPwvp3DcrtOcrEde+QZ8HRU8d2IKtP05MZKdEebAzhzygF/Mt0XNycJ1JxcF A9ZC7LrkpKu7n/yAkQzVAex3A/4JkLYa0raGohGEXhe3BpDV6KoI6jKbtRV8C8gdb33acXQ4b6yGe tnUVjZMIlYILFO5A8uDehnhDEoFSmgBELLw4lU2FyXOJzue653oVzf7qT+L8DQyEHHs2MTGqVHpv9 Gtr5mPSssR1kpQT1cYCci5YJep11J0+bYvyzSnPuorO75KJToJXJSoU4yhQ7MMWAUtRwMwKlbxPdZ xv06eKUzMWrdWFZLxq85yj7y3Jy11sg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMlGt-0005Wf-Ly; Wed, 14 Nov 2018 02:51:15 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMlGt-0005WQ-1z for ath10k@bombadil.infradead.org; Wed, 14 Nov 2018 02:51:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HKpb+7duFHHSHxo6LPilYi1gD1g7LMUj8KgWHrL+LYo=; b=tEKbF1y2DPhvsij9FMAMyGwYS Z++FAJXi7qPyYNE/0PGGcpRfLR55vEC1Leb/hxthi4/JsFQqCbja2XU+Dxkmw7qvG8NBOsIHQRR// 4lXSVUg23TFShG7AHwsOo9BsTFxt1Ru08udzP2ajqN/G71a9n1MuNH0qXiq5klXQ9Mdzw9Wb53DoS Bw9sXavuZ2OFcigIpsc1ch6c2YMhDKdx3lNQ6VMhGOGnyYMGpvMvpH7mWCBwc7OEG8KDuB+3cqAzQ wVlIrnpGMoJUQmobo+LugE29mhCeof8AODkny6iz/bkTEfhMOKBNF3kQWwQxorIYGG9nwL2Ba2a/H nkUy7nuMA==; Received: from smtp.codeaurora.org ([198.145.29.96]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMlGp-00025c-KV for ath10k@lists.infradead.org; Wed, 14 Nov 2018 02:51:13 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 12E0E604B4; Wed, 14 Nov 2018 02:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542163858; bh=yQGr0fJeAliZ2O/8ZedwZLIqxfkoENv8K54gqZZeC44=; h=From:To:Cc:Subject:Date:From; b=lf9nvdZNi9WBvNckZZVEtebOnSOH61d1s9vcJCFUJC0aNuIqMRrK3Z7BU2G6c2XWg QeVFu9kzYetAurJBOY51TnucVPi2MJi/PhcMH32wZf50dvR1TinuUQ8QLcJGdbz6GK TqosnAKwz+P+Of26TRpzaf1yN2hcx3nfZCEurjYE= Received: from localhost.localdomain (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wgong@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id F0C18601D4; Wed, 14 Nov 2018 02:50:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542163856; bh=yQGr0fJeAliZ2O/8ZedwZLIqxfkoENv8K54gqZZeC44=; h=From:To:Cc:Subject:Date:From; b=BONZ1A2kB2GsY7ZI3asazetcpG3ZUtIS0vdXewpztknoG3eKfrktt6tRcQ27RPk2g sSUZcqPqsUl4fXk48cZqNyNMs2Qcw7fzNXKUp6+6n4BOOWg042bNrcqlpYkgtJTyBx wR/7bBjzxAT6GzeooqECJpVkifoKGPcO0w+iL0EY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F0C18601D4 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=wgong@codeaurora.org From: Wen Gong To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: support PCIe enter L1 state Date: Wed, 14 Nov 2018 10:50:48 +0800 Message-Id: <1542163848-837-1-git-send-email-wgong@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181113_215111_802184_737FB501 X-CRM114-Status: GOOD ( 10.24 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP QCA6174A/QCA9377 PCIe chips support PCIe L1 and L1SS, and indicate the L1/L1SS capabilities in PCI configuration space. Currently ath10k driver write target PCIe config flags to disallow HW enter into L1, this leads some HW modules are still powered up even when both system PCIe RC and QCA6174A/QCA9377 endpoint decides to enter into L1 or L1SS. This cause ~12 mA power drain of bottom power consumption for all scenarios. Fix this issue by removing the drive code to write PCIe config flags. Tested with QCA6174 PCI with firmware WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI. It's not a regression with new firmware releases. Signed-off-by: Wen Gong --- drivers/net/wireless/ath/ath10k/pci.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index af2cf55..549da7a 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -2301,7 +2301,6 @@ int ath10k_pci_init_config(struct ath10k *ar) u32 pcie_state_targ_addr = 0; u32 pipe_cfg_targ_addr = 0; u32 svc_to_pipe_map = 0; - u32 pcie_config_flags = 0; u32 ealloc_value; u32 ealloc_targ_addr; u32 flag2_value; @@ -2374,26 +2373,6 @@ int ath10k_pci_init_config(struct ath10k *ar) return ret; } - ret = ath10k_pci_diag_read32(ar, (pcie_state_targ_addr + - offsetof(struct pcie_state, - config_flags)), - &pcie_config_flags); - if (ret != 0) { - ath10k_err(ar, "Failed to get pcie config_flags: %d\n", ret); - return ret; - } - - pcie_config_flags &= ~PCIE_CONFIG_FLAG_ENABLE_L1; - - ret = ath10k_pci_diag_write32(ar, (pcie_state_targ_addr + - offsetof(struct pcie_state, - config_flags)), - pcie_config_flags); - if (ret != 0) { - ath10k_err(ar, "Failed to write pcie config_flags: %d\n", ret); - return ret; - } - /* configure early allocation */ ealloc_targ_addr = host_interest_item_address(HI_ITEM(hi_early_alloc));