Re: [PATCH v5] PCI/ASPM: Add back L1 PM Substate save and restore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2024-01-11 at 14:28 +0200, Ilpo Järvinen wrote:
> On Wed, 10 Jan 2024, Bjorn Helgaas wrote:
> 
> > On Wed, Jan 10, 2024 at 07:24:31AM -0800, David E. Box wrote:
> > > On Thu, 2023-12-28 at 18:30 -0600, Bjorn Helgaas wrote:
> > > > On Thu, Dec 28, 2023 at 04:31:12PM -0600, Bjorn Helgaas wrote:
> > > > > On Wed, Dec 20, 2023 at 05:12:50PM -0800, David E. Box wrote:
> > 
> > > > > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > > > > > index 55bc3576a985..3c4b2647b4ca 100644
> > > > > > --- a/drivers/pci/pci.c
> > > > > > +++ b/drivers/pci/pci.c
> > > > 
> > > > > > @@ -1579,7 +1579,7 @@ static void pci_restore_pcie_state(struct
> > > > > > pci_dev
> > > > > > *dev)
> > > > > >  {
> > > > > > ...
> > > > 
> > > > > > +        So we restore here only the
> > > > > > +        * LNKCTL register with the ASPM control field clear. ASPM
> > > > > > will
> > > > > > +        * be restored in pci_restore_aspm_state().
> > > > > > +        */
> > > > > > +       val = cap[i++] & ~PCI_EXP_LNKCTL_ASPMC;
> > > > > > +       pcie_capability_write_word(dev, PCI_EXP_LNKCTL, val);
> > > > > 
> > > > > When CONFIG_PCIEASPM is not set, we will clear ASPMC here and never
> > > > > restore it.  I don't know if this ever happens.  Do we need to worry
> > > > > about this?  Might firmware restore ASPMC itself before we get here?
> > > > > What do we want to happen in this case?
> > > 
> > > I just checked this. L1 does get disabled which we don't want. We
> > > need to save and restore the BIOS ASPM configuration even when
> > > CONFIG_PCIEASPM is not set.
> > 
> > There's some other ASPM stuff that we want even when CONFIG_PCIEASPM
> > is not set.  I think some of that code is currently in probe.c and
> > pci.c.
> > 
> > I can't find it right now, but we had some discussion about moving
> > that code into aspm.c, compiling aspm.c unconditionally, and adding
> > CONFIG_PCIEASPM ifdefs inside it for these cases.  Maybe this is the
> > time do to that?  If so, probably a preliminary patch or two to do
> > the code movement without any functional changes, followed by the
> > actual fixes.
> 
> Hi,
> 
> It's here:
> 
> https://lore.kernel.org/linux-pci/20231011200442.GA1040348@bhelgaas/
> 
> I'm still not even half way done with the update for that patch series 
> because I got stuck while attempting to do the rtsx driver changes the 
> new way and moved to work on other stuff for a while.
> 
> So far I've only tentatively placed some #ifdef into aspm.c but it wasn't 
> all thought nor well arranged yet to limit the number of needed #ifdefs so
> nothing ready to be posted yet. And therefore not much effort is lost if 
> David wants to take a look at it instead in the meantime.

I'll take a stab at it.

David







[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux