From: Ajay Agarwal <ajayagarwal@google.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"David E. Box" <david.e.box@linux.intel.com>,
"Johan Hovold" <johan+linaro@kernel.org>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Manu Gautam" <manugautam@google.com>,
"Sajid Dalvi" <sdalvi@google.com>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Vidya Sagar" <vidyas@nvidia.com>,
"Shuai Xue" <xueshuai@linux.alibaba.com>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH v2] PCI/ASPM: Disable L1 before disabling L1ss
Date: Fri, 4 Oct 2024 08:30:27 +0530 [thread overview]
Message-ID: <Zv9aS_FpDZpvmGnQ@google.com> (raw)
In-Reply-To: <20241003202321.GA321551@bhelgaas>
On Thu, Oct 03, 2024 at 03:23:21PM -0500, Bjorn Helgaas wrote:
> On Thu, Oct 03, 2024 at 10:53:58PM +0530, Ajay Agarwal wrote:
> > On Thu, Oct 03, 2024 at 12:01:22PM -0500, Bjorn Helgaas wrote:
> > > On Thu, Oct 03, 2024 at 06:55:03PM +0530, Ajay Agarwal wrote:
> > > > The current sequence in the driver for L1ss update is as follows.
> > > >
> > > > Disable L1ss
> > > > Disable L1
> > > > Enable L1ss as required
> > > > Enable L1 if required
> > > >
> > > > With this sequence, a bus hang is observed during the L1ss
> > > > disable sequence when the RC CPU attempts to clear the RC L1ss
> > > > register after clearing the EP L1ss register.
> > >
> > > Thanks for this. What exactly does the bus hang look like to a user?
> > >
> > The CPU is just hung on reading the RC PCI_L1SS_CTL1 register. After
> > some time, the CPU watchdog expires and the system reboots.
>
> Wow. Good to know that this is outside the PCIe domain. I think this
> is a good change, and since it is partly motivated by hardware
> behavior that might be legal but seems somewhat unusual, can we
> identify the hardware (CPU and PCIe Root Complex) involved here?
>
The CPU is an ARM A-core. The PCIe RC is a Synopsys Designware core.
> > > I guess the problem happens in pcie_config_aspm_l1ss(), where we do:
> > >
> > > pci_clear_and_set_config_dword(child->l1ss + PCI_L1SS_CTL1, ... 0)
> > > pci_clear_and_set_config_dword(parent->l1ss + PCI_L1SS_CTL1, ... 0)
> > >
> > > where clearing the child (endpoint) PCI_L1SS_CTL1_L1_2_MASK works, but
> > > something goes wrong when clearing the parent (RP) mask? The
> > > clear_and_set will do a read followed by a write, and one of those
> > > causes some kind of error?
> > >
> > During ASPM disable, in pcie_config_aspm_l1ss(), we do:
> > 1. pci_clear_and_set_config_dword(child->l1ss + PCI_L1SS_CTL1, ... 0)
> > 2. pci_clear_and_set_config_dword(parent->l1ss + PCI_L1SS_CTL1, ... 0)
> > 3. pci_clear_and_set_config_dword(parent->l1ss + PCI_L1SS_CTL1, ... 0)
> > 4. pci_clear_and_set_config_dword(child->l1ss + PCI_L1SS_CTL1, ... 0)
> >
> > We observe that the steps 1 and 2 go through just fine. But the read of
> > PCI_L1SS_CTL1 register in the step 3 hangs. I am not sure why.
> > The issue is pretty difficult to reproduce, and adding prints around
> > these steps masks the issue.
>
> I guess the L1 disable is between 2 and 3, right? And 3 and 4 may
> enable L1 SS (using val, not 0)?
>
> 1. same
> 2. same
> 2.5 pcie_capability_clear_word(child, PCI_EXP_LNKCTL_ASPM_L1)
> 2.6 pcie_capability_clear_word(parent, PCI_EXP_LNKCTL_ASPM_L1)
> 3. pci_clear_and_set_config_dword(parent->l1ss + PCI_L1SS_CTL1, ... val)
> 4. pci_clear_and_set_config_dword(child->l1ss + PCI_L1SS_CTL1, ... val)
>
Thats the sequence when L1ss is enabled. When it is disabled, then steps
2.5 and 2.6 do not run. And 'val' remains 0.
> Bjorn
next prev parent reply other threads:[~2024-10-04 3:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 13:25 [PATCH v2] PCI/ASPM: Disable L1 before disabling L1ss Ajay Agarwal
2024-10-03 17:01 ` Bjorn Helgaas
2024-10-03 17:23 ` Ajay Agarwal
2024-10-03 20:23 ` Bjorn Helgaas
2024-10-04 3:00 ` Ajay Agarwal [this message]
2024-10-04 23:19 ` Bjorn Helgaas
2024-10-07 3:21 ` Ajay Agarwal
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=Zv9aS_FpDZpvmGnQ@google.com \
--to=ajayagarwal@google.com \
--cc=bhelgaas@google.com \
--cc=david.e.box@linux.intel.com \
--cc=helgaas@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=johan+linaro@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=manugautam@google.com \
--cc=sdalvi@google.com \
--cc=vidyas@nvidia.com \
--cc=xueshuai@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.