linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Sathyanarayanan Kuppuswamy  <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: linux-pci@vger.kernel.org, "Vidya Sagar" <vidyas@nvidia.com>,
	"Saheed O . Bolarinwa" <refactormyself@gmail.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rajat Jain" <rajatja@google.com>,
	"Kenneth R . Crudup" <kenny@panix.com>,
	"Kai-Heng Feng" <kai.heng.feng@canonical.com>,
	"Abhishek Sahu" <abhsahu@nvidia.com>,
	"Thierry Reding" <treding@nvidia.com>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Krishna Thota" <kthota@nvidia.com>,
	"Manikanta Maddireddy" <mmaddireddy@nvidia.com>,
	"Vidya Sagar" <sagar.tv@gmail.com>,
	sagupta@nvidia.com, linux-kernel@vger.kernel.org,
	"Bjorn Helgaas" <bhelgaas@google.com>
Subject: Re: [PATCH 2/3] PCI/ASPM: Ignore L1 PM Substates if device lacks capability
Date: Wed, 5 Oct 2022 06:07:51 -0500	[thread overview]
Message-ID: <20221005110751.GA2275321@bhelgaas> (raw)
In-Reply-To: <5799dca0-5ad2-be44-ae79-e276bd7e0a8c@linux.intel.com>

On Tue, Oct 04, 2022 at 08:26:53PM -0700, Sathyanarayanan Kuppuswamy wrote:
> On 10/4/22 7:58 PM, Bjorn Helgaas wrote:
> > 187f91db8237 ("PCI/ASPM: Remove struct aspm_register_info.l1ss_cap")
> > inadvertently removed a check for existence of the L1 PM Substates (L1SS)
> > Capability before reading it.
> > 
> > If there is no L1SS Capability, this means we mistakenly read PCI_COMMAND
> > and PCI_STATUS (config address 0x04) and interpret that as the PCI_L1SS_CAP
> > register, so we may incorrectly configure L1SS.
> > 
> > Make sure the L1SS Capability exists before trying to read it.
> > 
> > Fixes: 187f91db8237 ("PCI/ASPM: Remove struct aspm_register_info.l1ss_cap")
> > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> > ---
> >  drivers/pci/pcie/aspm.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> > index 4535228e4a64..f12d117f44e0 100644
> > --- a/drivers/pci/pcie/aspm.c
> > +++ b/drivers/pci/pcie/aspm.c
> > @@ -560,6 +560,9 @@ static void aspm_l1ss_init(struct pcie_link_state *link)
> >  	u32 parent_l1ss_cap, child_l1ss_cap;
> >  	u32 parent_l1ss_ctl1 = 0, child_l1ss_ctl1 = 0;
> >  
> > +	if (!parent->l1ss || !child->l1ss)
> > +		return;
> 
> I have noticed that l1ss state is initialized in pci_configure_ltr(). I am
> wondering whether it is the right place? Are L1SS and LTR related?

L1SS and LTR are definitely related -- LTR supplies information
that's needed for L1.2.

I'm not sure why pci_configure_ltr() is in probe.c and
pci_bridge_reconfigure_ltr() is in pci.c; maybe it would make
sense to put them both in aspm.c.  

Bjorn

  reply	other threads:[~2022-10-05 11:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05  2:58 [PATCH 0/3] PCI/ASPM: Fix L1SS issues Bjorn Helgaas
2022-10-05  2:58 ` [PATCH 1/3] PCI/ASPM: Factor out L1 PM Substates configuration Bjorn Helgaas
2022-10-05  2:58 ` [PATCH 2/3] PCI/ASPM: Ignore L1 PM Substates if device lacks capability Bjorn Helgaas
2022-10-05  3:26   ` Sathyanarayanan Kuppuswamy
2022-10-05 11:07     ` Bjorn Helgaas [this message]
2022-10-05  2:58 ` [PATCH 3/3] PCI/ASPM: Correct LTR_L1.2_THRESHOLD computation Bjorn Helgaas
2022-10-05  3:28 ` [PATCH 0/3] PCI/ASPM: Fix L1SS issues Sathyanarayanan Kuppuswamy
2022-10-05 17:57   ` Bjorn Helgaas

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=20221005110751.GA2275321@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=abhsahu@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=jonathanh@nvidia.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=kenny@panix.com \
    --cc=kthota@nvidia.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=rajatja@google.com \
    --cc=refactormyself@gmail.com \
    --cc=sagar.tv@gmail.com \
    --cc=sagupta@nvidia.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=treding@nvidia.com \
    --cc=vidyas@nvidia.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).