Re: [PATCH 1/2] PCI/ASPM: Override the ASPM and Clock PM states set by BIOS for devicetree platforms

From: Bjorn Helgaas
Date: Wed Sep 17 2025 - 07:22:28 EST


[+cc Kai-Heng, Rafael, Heiner, AceLan; response to
https://lore.kernel.org/r/20250916-pci-dt-aspm-v1-1-778fe907c9ad@xxxxxxxxxxxxxxxx]

On Wed, Sep 17, 2025 at 04:14:42PM +0530, Manivannan Sadhasivam wrote:
> On Tue, Sep 16, 2025 at 12:15:46PM GMT, Bjorn Helgaas wrote:
> > On Tue, Sep 16, 2025 at 09:42:52PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> > > So far, the PCI subsystem has honored the ASPM and Clock PM states set by
> > > the BIOS (through LNKCTL) during device initialization. This was done
> > > conservatively to avoid issues with the buggy devices that advertise
> > > ASPM capabilities, but behave erratically if the ASPM states are enabled.
> > > So the PCI subsystem ended up trusting the BIOS to enable only the ASPM
> > > states that were known to work for the devices.
> ...

> > For debuggability, I wonder if we should have a pci_dbg() at the point
> > where we actually update PCI_EXP_LNKCTL, PCI_L1SS_CTL1, etc? I could
> > even argue for pci_info() since this should be a low-frequency and
> > relatively high-risk event.
>
> I don't know why we should print register settings since we are explicitly
> printing out what states are getting enabled.

My thinking here is that we care about is what is actually written to
the device, not what we *intend* to write to the device.

There's a lot of complicated aspm.c code between setting
link->clkpm_default/aspm_default and actually programming the device,
and when debugging a problem, I don't want to have to parse all that
code to derive the register values.