]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI: stm32: Fix LTSSM EP race with start link
authorChristian Bruel <christian.bruel@foss.st.com>
Fri, 14 Nov 2025 07:45:52 +0000 (08:45 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 17 Nov 2025 20:32:51 +0000 (14:32 -0600)
commitfa81d6099007728cae39c6f937d83903bbddab5e
treea90d5bbd392d9a2b05dd44b4b017a4b9cdda11b3
parent3a8660878839faadb4f1a6dd72c3179c1df56787
PCI: stm32: Fix LTSSM EP race with start link

If the host has deasserted PERST# and started link training before the link
is started on EP side, enabling LTSSM before the endpoint registers are
initialized in the perst_irq handler results in probing incorrect values.

Thus, wait for the PERST# level-triggered interrupt to start link training
at the end of initialization and cleanup the stm32_pcie_[start stop]_link
functions.

Fixes: 151f3d29baf4 ("PCI: stm32-ep: Add PCIe Endpoint support for STM32MP25")
Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
[mani: added fixes tag]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
[bhelgaas: wrap line]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20251114-perst_ep-v1-1-e7976317a890@foss.st.com
drivers/pci/controller/dwc/pcie-stm32-ep.c