[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221005110751.GA2275321@bhelgaas>
Date: Wed, 5 Oct 2022 06:07:51 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Sathyanarayanan Kuppuswamy
<sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc: linux-pci@...r.kernel.org, Vidya Sagar <vidyas@...dia.com>,
"Saheed O . Bolarinwa" <refactormyself@...il.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Rajat Jain <rajatja@...gle.com>,
"Kenneth R . Crudup" <kenny@...ix.com>,
Kai-Heng Feng <kai.heng.feng@...onical.com>,
Abhishek Sahu <abhsahu@...dia.com>,
Thierry Reding <treding@...dia.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Krishna Thota <kthota@...dia.com>,
Manikanta Maddireddy <mmaddireddy@...dia.com>,
Vidya Sagar <sagar.tv@...il.com>, sagupta@...dia.com,
linux-kernel@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH 2/3] PCI/ASPM: Ignore L1 PM Substates if device lacks
capability
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@...gle.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
Powered by blists - more mailing lists