]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:03 +0000 (14:03 +0100)
commit0e82816b68968ae3011386cdb60da0305842ee04
tree4056854b653864d912c9bcdc4baa912914a75332
parent7b1e3cb2070e2dc0bef3718fb483e1fdef587fab
PCI: stm32: Fix LTSSM EP race with start link

[ Upstream commit fa81d6099007728cae39c6f937d83903bbddab5e ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/dwc/pcie-stm32-ep.c