Re: [PATCH] PCI: spacemit: Ignore PERST# bit for controllers

From: Ali Tariq

Date: Wed Nov 04 2026 - 11:03:53 EST




On 11/4/26 7:14 PM, Troy Mitchell wrote:
On Wed Nov 4, 2026 at 2:07 PM GMT, Ali Tariq wrote:
The k1_pcie_init() does not set PCIE_IGNORE_PERSTN bit of the
control logic register, which causes controller to reset itself once
PERST# signal is asserted even when acting as host.
On Orange Pi RV2 (SpacemiT K1), this resets the controller and wipes
the IDs. k1_pcie_deinit() leaves PERST# asserted, so when k1_pcie_init()
runs again, its first DBI access hangs the CPU.

Set PCIE_IGNORE_PERSTN bit of the control logic register of APMU
in k1_pcie_init() before enabling resources so controllers
dont end up resetting themselves when PERST# signal is asserted.

Fixes: ff64e078e45f ("PCI: spacemit: Add SpacemiT PCIe host driver")
Signed-off-by: Ali Tariq <alitariq45892@xxxxxxxxx>
---
Hang log: https://kernelci.cloud-v.co/scheduler/job/420
Fixed Log: https://kernelci.cloud-v.co/scheduler/job/430
---
drivers/pci/controller/dwc/pcie-spacemit-k1.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-spacemit-k1.c b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
index 92a71ea90ac3..af6028e8825a 100644
--- a/drivers/pci/controller/dwc/pcie-spacemit-k1.c
+++ b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
@@ -47,6 +47,7 @@
#define PCIE_CONTROL_LOGIC 0x0004
#define PCIE_SOFT_RESET BIT(0)
+#define PCIE_IGNORE_PERSTN BIT(2) /* 1: ignore PERST# */
A similar but earlier patch can be found here [1]

Link: https://lore.kernel.org/all/20260924-spacemit-k1-pcie-fix-v1-1-002b5c1ba9fc@xxxxxxxxxxxxxxxxxx/ [1]


Thank you for pointing.

I missed that. I will check that patch.

You can drop my patch.

Regards,
Ali