Message ID | 20230918131103.24119-12-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2983347vqi; Mon, 18 Sep 2023 15:10:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsjKbOER9/5Wz3teZgklPItVYG9xXvzmdHMqHCzxtzX6lALUpMytOELtWmJdQDtsZnLL4K X-Received: by 2002:a17:90a:bb03:b0:267:eefe:d0b5 with SMTP id u3-20020a17090abb0300b00267eefed0b5mr9191335pjr.46.1695075022788; Mon, 18 Sep 2023 15:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695075022; cv=none; d=google.com; s=arc-20160816; b=uZoWwhIyOVxgPmI+3Aq9UDq43CjFIEq757zO+/0xgfQK3mY+vK0kzgukDyTdt6LyTz ecjNn1kRI62/m669edXNc5TQsAjCJ8CKMeogeJPx81ZDfzie483dvSBsaYDfKMclsbYe pqZSsJq8Dd6qO/di4ifVAKmXDCJtHLd9ZTxfM5nLRDoIBocubkQTXP6eY4RcpjW15SgX JWPjDq6ckpAywzt1AvjXVSbLVtQiBbC2Q65Ul1S6wEUiAtEh0AC6SlYs76LqAZIJTOFz pCwFZKCr6U2jXqm0pVtFnF5honWghAJ2V5KFg4ZJMgqSKKuqHM9MdnvrLLvx13h1Hit8 vkgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JEWlB+vb01n5HuMc8lzVnMTu2oDHzr5DfZ087w7HOPo=; fh=0XtxFfPJ0+h+th/1hGwweltSBJ4b8+b0QNNkHIMyCKE=; b=fhSNlvsUwJ2zng5bMDONy1H4VlbLmK/vcg61KBErAgR956Hd8gP9nIXfIOaXTj97nN CqSOcRllS9n3bWjCZZ7izHC6LjkLlD5m6EbK50nUuS+RCf72vBQ9pEVk7H5pabKcfkzb yAdZdoCiF0XkUAO9FwXALP8p8qe79fzXiE8wLcOmFmAypRvbMEmD7wxsrbkKGrQsijfM XqhKHTg2bqdf1ezdF+ckXju6vUa98fZTqDfjK3DYicg7o6y32zU9g2XoeqFSChYKNopl XYQL4FQRE/0Mw0GZuYXEYdV2exXrgoT8tTM0wHYHQGp0n7Rt1/6ygEpMZzkQaY9JlTQ8 f29Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g2uLs8OA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ng8-20020a17090b1a8800b0025eeb3cc4b2si9181037pjb.9.2023.09.18.15.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 15:10:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g2uLs8OA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B008481B4AF0; Mon, 18 Sep 2023 08:48:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbjIRPsf (ORCPT <rfc822;kernel.ruili@gmail.com> + 25 others); Mon, 18 Sep 2023 11:48:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbjIRPsc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 11:48:32 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93351CFC; Mon, 18 Sep 2023 08:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695051983; x=1726587983; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=s0vQPYCvTArOJ8UKcbPeJ71cltUHLof64ZzmndGbOp4=; b=g2uLs8OADS77SXqB3EuVJrEreMnzHFPTafxvzmdEL/C30iUp3zH7jq1d ABZ3Kgh5gdJWDrpY5cUPNAW0MC6MwehHgL8SJnJWsyivkRwisemiLfzRD JkRNPbicHlrpKkMhHoxPsPyTChaGYZWWo9+635t/DgCn0pxxUem/ScJGT 4SLlJpWs3qxKi0/KMeTdVUlZ787kIuyPnPSg8tREZhknRBZJx+ocIwy8D LwpMktM8zntgHLuDzWer72KmurJ5RX9+isF15HXWJoMsVjFIyeFEABBjp SRMTXuInJSNLU6fsVFUgEno8xmvLj+zQAa0qNs2pEZq25iAy6AzZxGniE Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="446113610" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="446113610" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 06:13:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="811343017" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="811343017" Received: from nprotaso-mobl1.ccr.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.252.49.156]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 06:13:39 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Rob Herring <robh@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= <kw@linux.com>, Lukas Wunner <lukas@wunner.de>, "Rafael J . Wysocki" <rafael@kernel.org>, Heiner Kallweit <hkallweit1@gmail.com>, Emmanuel Grumbach <emmanuel.grumbach@intel.com>, linux-kernel@vger.kernel.org, Kalle Valo <kvalo@kernel.org>, Jeff Johnson <quic_jjohnson@quicinc.com>, ath12k@lists.infradead.org, linux-wireless@vger.kernel.org Cc: ath10k@lists.infradead.org, ath11k@lists.infradead.org, intel-wired-lan@lists.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, =?utf-8?q?Ilpo_J=C3=A4r?= =?utf-8?q?vinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH v2 11/13] wifi: ath12k: Use pci_disable/enable_link_state() Date: Mon, 18 Sep 2023 16:11:01 +0300 Message-Id: <20230918131103.24119-12-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230918131103.24119-1-ilpo.jarvinen@linux.intel.com> References: <20230918131103.24119-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 18 Sep 2023 08:48:52 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777414986633372343 X-GMAIL-MSGID: 1777414986633372343 |
Series |
PCI/ASPM: Make ASPM in core robust and remove driver workarounds
|
|
Commit Message
Ilpo Järvinen
Sept. 18, 2023, 1:11 p.m. UTC
ath12k driver adjusts ASPM state itself which leaves ASPM service
driver in PCI core unaware of the link state changes the driver
implemented.
Call pci_disable_link_state() and pci_enable_link_state() instead of
adjusting ASPMC field in LNKCTL directly in the driver and let PCI core
handle the ASPM state management.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/net/wireless/ath/ath12k/pci.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
Comments
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> writes: > ath12k driver adjusts ASPM state itself which leaves ASPM service > driver in PCI core unaware of the link state changes the driver > implemented. > > Call pci_disable_link_state() and pci_enable_link_state() instead of > adjusting ASPMC field in LNKCTL directly in the driver and let PCI core > handle the ASPM state management. > > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Acked-by: Kalle Valo <kvalo@kernel.org>
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index fae5dfd6e9d7..9401f62476be 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -794,19 +794,15 @@ static void ath12k_pci_aspm_disable(struct ath12k_pci *ab_pci) u16_get_bits(ab_pci->link_ctl, PCI_EXP_LNKCTL_ASPM_L1)); /* disable L0s and L1 */ - pcie_capability_clear_word(ab_pci->pdev, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_ASPMC); - + pci_disable_link_state(ab_pci->pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); set_bit(ATH12K_PCI_ASPM_RESTORE, &ab_pci->flags); } static void ath12k_pci_aspm_restore(struct ath12k_pci *ab_pci) { if (test_and_clear_bit(ATH12K_PCI_ASPM_RESTORE, &ab_pci->flags)) - pcie_capability_clear_and_set_word(ab_pci->pdev, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_ASPMC, - ab_pci->link_ctl & - PCI_EXP_LNKCTL_ASPMC); + pci_enable_link_state(ab_pci->pdev, ab_pci->link_ctl & + (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1)); } static void ath12k_pci_kill_tasklets(struct ath12k_base *ab)