Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: meson: Fix PERST# timing by asserting reset before LTSSM enable
@ 2026-06-14  1:56 Gowtham Kudupudi
  2026-06-15 10:34 ` Ronald Claveau
  0 siblings, 1 reply; 4+ messages in thread
From: Gowtham Kudupudi @ 2026-06-14  1:56 UTC (permalink / raw)
  To: yue.wang, lpieralisi, kwilczynski, mani
  Cc: robh, bhelgaas, neil.armstrong, khilman, jbrunet,
	martin.blumenstingl, linux-pci, linux-amlogic, linux-arm-kernel,
	linux-kernel, Gowtham Kudupudi

On warm reboot, the PCIe controller's LTSSM starts link training
immediately if PERST# is already deasserted from the previous boot.
The driver then pulses PERST# for only 500us, which is too short to
properly reset the endpoint device that has already started training.

Fix by moving the PERST# assert/deassert pulse BEFORE enabling LTSSM,
so the endpoint gets a clean reset cycle before link training begins.

This was found on Amlogic G12B (A311D) with NVMe on an M.2 slot.
Cold boot worked because POR held PERST# low; warm reboot did not.
The fix was confirmed on a Banana Pi CM4 with Waveshare IO base board.

Signed-off-by: Gowtham Kudupudi <gowtham@ferryfair.com>
---
 drivers/pci/controller/dwc/pci-meson.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index 5f8e2f4b3c12..3a7e9f1d5b8c 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -310,8 +310,8 @@ static int meson_pcie_start_link(struct dw_pcie *pci)
 {
 	struct meson_pcie *mp = to_meson_pcie(pci);
 
+	meson_pcie_assert_reset(mp);
 	meson_pcie_ltssm_enable(mp);
-	meson_pcie_assert_reset(mp);
 
 	return 0;
 }
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-16 23:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-14  1:56 [PATCH] PCI: meson: Fix PERST# timing by asserting reset before LTSSM enable Gowtham Kudupudi
2026-06-15 10:34 ` Ronald Claveau
2026-06-16  6:06   ` neil.armstrong
2026-06-16 23:36     ` gowtham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox