public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "David E. Box" <david.e.box@linux.intel.com>,
	bhelgaas@google.com,
	 Mika Westerberg <mika.westerberg@linux.intel.com>,
	 sathyanarayanan.kuppuswamy@linux.intel.com, vidyas@nvidia.com,
	 rafael.j.wysocki@intel.com, kai.heng.feng@canonical.com,
	 tasev.stefanoska@skynet.be, enriquezmark36@gmail.com,
	kernel@witt.link,  koba.ko@canonical.com,
	wse@tuxedocomputers.com, ricky_wu@realtek.com,
	 linux-pci@vger.kernel.org,
	Michael Schaller <michael@5challer.de>
Subject: Re: [PATCH v5] PCI/ASPM: Add back L1 PM Substate save and restore
Date: Thu, 11 Jan 2024 14:28:06 +0200 (EET)	[thread overview]
Message-ID: <6e258022-229f-88bc-037f-18b0a1568bbf@linux.intel.com> (raw)
In-Reply-To: <20240110184659.GA2113074@bhelgaas>

[-- Attachment #1: Type: text/plain, Size: 2556 bytes --]

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.

  reply	other threads:[~2024-01-11 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  1:12 [PATCH v5] PCI/ASPM: Add back L1 PM Substate save and restore David E. Box
2023-12-21 10:43 ` Mika Westerberg
2023-12-28 22:31 ` Bjorn Helgaas
2023-12-29  0:30   ` Bjorn Helgaas
2024-01-10 15:24     ` David E. Box
2024-01-10 18:46       ` Bjorn Helgaas
2024-01-11 12:28         ` Ilpo Järvinen [this message]
2024-01-13  0:36           ` David E. 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=6e258022-229f-88bc-037f-18b0a1568bbf@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=david.e.box@linux.intel.com \
    --cc=enriquezmark36@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=kernel@witt.link \
    --cc=koba.ko@canonical.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=michael@5challer.de \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ricky_wu@realtek.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=tasev.stefanoska@skynet.be \
    --cc=vidyas@nvidia.com \
    --cc=wse@tuxedocomputers.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