Re: [PATCH v2] PCI: vmd: Enable PCI PM's L1 substates of remapped PCIe Root Port and NVMe

From: Bjorn Helgaas
Date: Tue Feb 06 2024 - 11:01:10 EST


On Tue, Feb 06, 2024 at 02:29:12PM +0200, Ilpo Järvinen wrote:
> On Fri, 2 Feb 2024, Jian-Hong Pan wrote:
> ...

> > +out_enable_link_state:
> > + /*
> > + * Make PCI devices at D0 when enable PCI-PM L1 PM Substates from
> > + * Section 5.5.4 of PCIe Base Spec Revision 6.0
>
> I don't understand what are you trying to say here? Are there some typos
> or grammar errors or something entire missing from the comment?

This is about the fact that per sec 5.5.4, "If setting either or both
of the enable bits for PCI-PM L1 PM Substates, both ports must be
configured as described in this section while in D0."

We can wordsmith this a little, maybe:

Ensure devices are in D0 before enabling PCI-PM L1 PM Substates, per
PCIe r6.0, sec 5.5.4.

I look a little askance at having to do this separately from
pci_enable_link_state_locked(), but we can solve that elsewhere if
need be.

> > + pci_set_power_state_locked(pdev, PCI_D0);
> > + pci_enable_link_state_locked(pdev, PCIE_LINK_STATE_ALL);