linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David E. Box" <david.e.box@linux.intel.com>
To: rafael@kernel.org, bhelgaas@google.com,
	vicamo.yang@canonical.com, kenny@panix.com,
	nirmal.patel@linux.intel.com
Cc: "David E. Box" <david.e.box@linux.intel.com>,
	linux-pm@vger.kernel.org, linux-pci@vger.kernel.org,
	ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org
Subject: [RFC 2/2] PCI: vmd: Provide default ASPM link state for synthetic hierarchy
Date: Wed, 16 Jul 2025 17:40:26 -0700	[thread overview]
Message-ID: <20250717004034.2998443-3-david.e.box@linux.intel.com> (raw)
In-Reply-To: <20250717004034.2998443-1-david.e.box@linux.intel.com>

Devices behind the VMD controller reside on a synthetic PCIe hierarchy that
is not visible to ACPI and not configured by firmware. As a result, these
devices receive no ASPM defaults from the BIOS, and ASPM remains disabled
unless explicitly enabled later.

Now that the ASPM core supports driver-supplied default link states via
pci_bus->aspm_bus_link_state, set this field on the VMD root bus to enable
ASPM for devices in the VMD domain. This ensures the platform's intended
power-saving configuration is applied during initialization without
requiring any special-case logic in the ASPM core.

Link: https://lore.kernel.org/linux-pm/0b166ece-eeec-ba5d-2212-50d995611cef@panix.com
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
 drivers/pci/controller/vmd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 8df064b62a2f..a0d4e96ce872 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -730,7 +730,7 @@ static void vmd_copy_host_bridge_flags(struct pci_host_bridge *root_bridge,
 }
 
 /*
- * Enable ASPM and LTR settings on devices that aren't configured by BIOS.
+ * Enable LTR settings on devices that aren't configured by BIOS.
  */
 static int vmd_pm_enable_quirk(struct pci_dev *pdev, void *userdata)
 {
@@ -770,7 +770,6 @@ static int vmd_pm_enable_quirk(struct pci_dev *pdev, void *userdata)
 	 * PCIe r6.0, sec 5.5.4.
 	 */
 	pci_set_power_state_locked(pdev, PCI_D0);
-	pci_enable_link_state_locked(pdev, PCIE_LINK_STATE_ALL);
 	return 0;
 }
 
@@ -911,6 +910,10 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 		return -ENODEV;
 	}
 
+#ifdef CONFIG_PCIEASPM
+	vmd->bus->aspm_bus_link_state = PCIE_LINK_STATE_ALL;
+#endif
+
 	vmd_copy_host_bridge_flags(pci_find_host_bridge(vmd->dev->bus),
 				   to_pci_host_bridge(vmd->bus->bridge));
 
-- 
2.43.0


  parent reply	other threads:[~2025-07-17  0:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17  0:40 [RFC 0/2] PCI/ASPM: Allow controller-defined default link state David E. Box
2025-07-17  0:40 ` [RFC 1/2] PCI/ASPM: Allow drivers to provide ASPM link state via pci_bus David E. Box
2025-07-17 10:00   ` Rafael J. Wysocki
2025-07-17  0:40 ` David E. Box [this message]
2025-07-17  6:12 ` [RFC 0/2] PCI/ASPM: Allow controller-defined default link state Kenneth R. Crudup
2025-07-17  6:57   ` Manivannan Sadhasivam
2025-07-17 14:03     ` David Box
2025-07-17  6:55 ` Manivannan Sadhasivam
2025-07-17 10:03   ` Rafael J. Wysocki
2025-07-17 14:13     ` David Box
2025-07-17 15:37       ` Rafael J. Wysocki
2025-07-17 17:49         ` David Box

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250717004034.2998443-3-david.e.box@linux.intel.com \
    --to=david.e.box@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kenny@panix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nirmal.patel@linux.intel.com \
    --cc=rafael@kernel.org \
    --cc=vicamo.yang@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).