Message ID | 20240223205851.114931-3-helgaas@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-79154-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp841980dyb; Fri, 23 Feb 2024 13:01:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXoIegk+bjUos0B45OXdQXVw10NaFUyOKkew1HDrsRLLAtJOT95GhR9mBvyTjtkThuZFYjgrrXBpDWo+3iuA44eiea1nw== X-Google-Smtp-Source: AGHT+IGGluzN6bm5uKYCMBhL1GF6J55nfdRACWgSWmgiXXeHhH9i5zJpRZB/94QpH0JyMdFclqBO X-Received: by 2002:aa7:9d88:0:b0:6e4:62d9:6490 with SMTP id f8-20020aa79d88000000b006e462d96490mr783409pfq.6.1708722117101; Fri, 23 Feb 2024 13:01:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708722117; cv=pass; d=google.com; s=arc-20160816; b=oxlxjVtTVcyQ79mV3TOm3aQAjd7zQb9toKJ9+x1eJxWIl+EsRNWokQKTVpvHpBxKDM fGFAiY8odFHUKGgJCnRM85+TwyNRhpUssxkGkc93DcnxkN0+zlDqYYg48ibE5m/tYlnZ GFxgIVDUxQvrUOErvh+gz9vbatCABn8y1U0rufNXq9eSgcop0LQGY4UhHCt/OV++0DkS GEXCRAnpIJOXt3ukAM81gycwceYIkReDZoCo2Ezu0axBZ5+6vyrxp65I9YvfsQJdElym t7OF8Ohi4lnkelCQrn7qnDotaiAuhQAvWWRd5Ug7jbXE6GaRtAa0xhQJHIvBpMMgKIvM rpXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=lAxKNWrb6EPk72Uh69l5cejT5/EZembBXbOOAIZAOVc=; fh=UOtCQvdtLRjYu4lpt5Tw8oOZkSAAXsqpAt775wBcPRQ=; b=ABiUjfzZugdTWnw+czyyhUIuRkRAzaZy/lYEO41CW92DEXgJcyubxBpTY/1tRAhfUr UNLDycWMvOF+0ahapODiKKrsW3P+dJKpC8OOnPW5bVv0O2mVLvNdfUXdArh7WHTR7vmq ++d0Z+kzHFwaYOMH0MvCIdtzg27UxKsSDMWh5VFytrIs0MoQQWcr3cg6YM5DlxgBmBEp lxWMdePZg7o3mdc0pYpxgKi2f8jtTeGt19aLF/mc2+XcfcExkE5nW/QMKe5SPzLhBayW FPTUIQoE5VZQWBddXB2zNA0f3XvN1R+ANPS8WRr8peZsBmPmCFzoIOPArPuQp7AXO9N6 UQCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IJDP2nx7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79154-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79154-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h15-20020a056a00170f00b006e465f8059bsi9728644pfc.278.2024.02.23.13.01.56 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 13:01:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79154-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IJDP2nx7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79154-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79154-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D8EA5B228B3 for <ouuuleilei@gmail.com>; Fri, 23 Feb 2024 20:59:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CFD614CAA5; Fri, 23 Feb 2024 20:59:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IJDP2nx7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8023149397; Fri, 23 Feb 2024 20:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708721939; cv=none; b=CIquBULENHipGU+g7Ap15ycufAriKg1y58Q04Qn0sBy8ZhcRYBKzG8Qx+G82ZjG9t37TxWtDuVfyC7ygxT+3MNfAW9irG60g6hfpxVgNxF1FXWYTGpx8Y3gKNv6cCUjKEI7Y1q20TwbzYJ+QkDWJ3SZ2Pv4qvDvMx2TCeQwuHw0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708721939; c=relaxed/simple; bh=x65rMjAkCbuMIIOI1rAb9CSZyHu2Knp8Gr3cSU2oInE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fcymUZM2vH5eX22LlcpVymG2t4Qwd2B6eDn3sezNUnznICEGODCpv1WCwOwM0aKBUttnkEmWHocviTflx115vitL9KQsxREmTsIZYjBGaXBnHyBg9zGg+dQlZpwuJ/r2UyfH+F3Qq1dBJry9hQDBVvtSnldryYsUHjNGWnLqX7I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IJDP2nx7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37E6EC43390; Fri, 23 Feb 2024 20:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708721938; bh=x65rMjAkCbuMIIOI1rAb9CSZyHu2Knp8Gr3cSU2oInE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IJDP2nx70+e8AzyQeZipolaoUklfvNpG55x5LxdePBmRDfB60VHt0l1Q7tj82p2vT aa9gXGE7m11cd7Y22Xwe4u/i6kSG4qRI6obFvMJ7lb8teTVubeWRximRxoOurNqMRw D8IfqM2BRrPBp5PgL/Qy8Jr7vW0K25H47oDSt1HD0zIx405bj0q0AZC2x8bPX7JTCZ K8EVXO+E+KXbCSnalTa/K3yle4RkfUgFAjQEdamNW/lxJz5yBBBp6odAyEN5xpTNUN 3PBwim9CtmIgHCSZMM9tJuG5JegzeHxGtLzSLTkKVh8d/JmE614eIPHo6WH3o55/Pa HBJIbKZffYZzQ== From: Bjorn Helgaas <helgaas@kernel.org> To: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Mika Westerberg <mika.westerberg@linux.intel.com>, "David E . Box" <david.e.box@linux.intel.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>, "Rafael J . Wysocki" <rafael@kernel.org>, Tasev Nikola <tasev.stefanoska@skynet.be>, Mark Enriquez <enriquezmark36@gmail.com>, Thomas Witt <kernel@witt.link>, Werner Sembach <wse@tuxedocomputers.com>, Vidya Sagar <vidyas@nvidia.com>, Kai-Heng Feng <kai.heng.feng@canonical.com>, Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>, Ricky Wu <ricky_wu@realtek.com>, Mario Limonciello <mario.limonciello@amd.com>, Bjorn Helgaas <bhelgaas@google.com> Subject: [PATCH v7 2/5] PCI/ASPM: Always build aspm.c Date: Fri, 23 Feb 2024 14:58:48 -0600 Message-Id: <20240223205851.114931-3-helgaas@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240223205851.114931-1-helgaas@kernel.org> References: <20240223205851.114931-1-helgaas@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791725002374495939 X-GMAIL-MSGID: 1791725002374495939 |
Series |
PCI/ASPM: Save/restore L1 PM Substates for suspend/resume
|
|
Commit Message
Bjorn Helgaas
Feb. 23, 2024, 8:58 p.m. UTC
From: "David E. Box" <david.e.box@linux.intel.com> Some ASPM-related tasks, such as save and restore of LTR and L1SS capabilities, still need to be performed when CONFIG_PCIEASPM is not enabled. To prepare for these changes, wrap the current code in aspm.c with an #ifdef and always build the file. Link: https://lore.kernel.org/r/20240128233212.1139663-2-david.e.box@linux.intel.com Signed-off-by: David E. Box <david.e.box@linux.intel.com> [bhelgaas: split build change from function moves] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> --- drivers/pci/pcie/Makefile | 2 +- drivers/pci/pcie/aspm.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
Comments
On 2/23/24 12:58 PM, Bjorn Helgaas wrote: > From: "David E. Box" <david.e.box@linux.intel.com> > > Some ASPM-related tasks, such as save and restore of LTR and L1SS > capabilities, still need to be performed when CONFIG_PCIEASPM is not > enabled. To prepare for these changes, wrap the current code in aspm.c > with an #ifdef and always build the file. Since save/restore needs to be called even if CONFIG_PCIEASPM is not set, why not just leave it in pci.c? > > Link: https://lore.kernel.org/r/20240128233212.1139663-2-david.e.box@linux.intel.com > Signed-off-by: David E. Box <david.e.box@linux.intel.com> > [bhelgaas: split build change from function moves] > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> > --- > drivers/pci/pcie/Makefile | 2 +- > drivers/pci/pcie/aspm.c | 4 ++++ > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/Makefile b/drivers/pci/pcie/Makefile > index 8de4ed5f98f1..6461aa93fe76 100644 > --- a/drivers/pci/pcie/Makefile > +++ b/drivers/pci/pcie/Makefile > @@ -6,7 +6,7 @@ pcieportdrv-y := portdrv.o rcec.o > > obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o > > -obj-$(CONFIG_PCIEASPM) += aspm.o > +obj-y += aspm.o > obj-$(CONFIG_PCIEAER) += aer.o err.o > obj-$(CONFIG_PCIEAER_INJECT) += aer_inject.o > obj-$(CONFIG_PCIE_PME) += pme.o > diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c > index d1538f73f2f9..d50c0f83430f 100644 > --- a/drivers/pci/pcie/aspm.c > +++ b/drivers/pci/pcie/aspm.c > @@ -24,6 +24,8 @@ > > #include "../pci.h" > > +#ifdef CONFIG_PCIEASPM > + > #ifdef MODULE_PARAM_PREFIX > #undef MODULE_PARAM_PREFIX > #endif > @@ -1517,3 +1519,5 @@ bool pcie_aspm_support_enabled(void) > { > return aspm_support_enabled; > } > + > +#endif /* CONFIG_PCIEASPM */
On Sun, Feb 25, 2024 at 10:44:14PM -0800, Kuppuswamy Sathyanarayanan wrote: > On 2/23/24 12:58 PM, Bjorn Helgaas wrote: > > From: "David E. Box" <david.e.box@linux.intel.com> > > > > Some ASPM-related tasks, such as save and restore of LTR and L1SS > > capabilities, still need to be performed when CONFIG_PCIEASPM is not > > enabled. To prepare for these changes, wrap the current code in aspm.c > > with an #ifdef and always build the file. > > Since save/restore needs to be called even if CONFIG_PCIEASPM is > not set, why not just leave it in pci.c? We could do that, but we're accumulating various bits of ASPM-related suspend/resume functionality (LTR, L1SS, etc) that seem like they fit better in aspm.c. Bjorn
diff --git a/drivers/pci/pcie/Makefile b/drivers/pci/pcie/Makefile index 8de4ed5f98f1..6461aa93fe76 100644 --- a/drivers/pci/pcie/Makefile +++ b/drivers/pci/pcie/Makefile @@ -6,7 +6,7 @@ pcieportdrv-y := portdrv.o rcec.o obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o -obj-$(CONFIG_PCIEASPM) += aspm.o +obj-y += aspm.o obj-$(CONFIG_PCIEAER) += aer.o err.o obj-$(CONFIG_PCIEAER_INJECT) += aer_inject.o obj-$(CONFIG_PCIE_PME) += pme.o diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index d1538f73f2f9..d50c0f83430f 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -24,6 +24,8 @@ #include "../pci.h" +#ifdef CONFIG_PCIEASPM + #ifdef MODULE_PARAM_PREFIX #undef MODULE_PARAM_PREFIX #endif @@ -1517,3 +1519,5 @@ bool pcie_aspm_support_enabled(void) { return aspm_support_enabled; } + +#endif /* CONFIG_PCIEASPM */