* [PATCH] PCI: spacemit: Ignore link partner PERST on K1
@ 2026-09-24 2:04 Encrow Thorne
2026-09-24 2:23 ` Troy Mitchell
2026-10-18 4:26 ` Manivannan Sadhasivam
0 siblings, 2 replies; 5+ messages in thread
From: Encrow Thorne @ 2026-09-24 2:04 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Yixun Lan,
Troy Mitchell
Cc: linux-pci, linux-riscv, spacemit, linux-kernel, Encrow Thorne
The K1 PCIe controller and PHY are affected by the PERST signal from
the link partner during initialization. With some devices connected,
this can prevent host initialization from progressing and cause the
system to hang while probing the PCIe controller.
Set PCIE_IGNORE_PERSTN before accessing the DBI registers. When set,
this bit makes both the PCIe controller and PHY ignore the PERST
signal from the link partner.
This allows host initialization to complete without being affected by
the link partner's PERST state.
Signed-off-by: Encrow Thorne <encrow.thorne@linux.spacemit.com>
---
drivers/pci/controller/dwc/pcie-spacemit-k1.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pci/controller/dwc/pcie-spacemit-k1.c b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
index 0564c46e2f48..98f067e1ba81 100644
--- a/drivers/pci/controller/dwc/pcie-spacemit-k1.c
+++ b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
@@ -44,6 +44,7 @@
#define PCIE_CONTROL_LOGIC 0x0004
#define PCIE_SOFT_RESET BIT(0)
+#define PCIE_IGNORE_PERSTN BIT(2)
struct k1_pcie {
struct dw_pcie pci;
@@ -137,6 +138,13 @@ static int k1_pcie_init(struct dw_pcie_rp *pp)
if (ret)
return ret;
+ /*
+ * When set to 1, the PCIe controller and PHY ignore the PERST signal
+ * from the link partner in both RC and EP modes.
+ */
+ regmap_set_bits(k1->pmu, k1->pmu_off + PCIE_CONTROL_LOGIC,
+ PCIE_IGNORE_PERSTN);
+
/* Set the PCI vendor and device ID */
dw_pcie_dbi_ro_wr_en(pci);
dw_pcie_writew_dbi(pci, PCI_VENDOR_ID, PCI_VENDOR_ID_SPACEMIT);
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260921-spacemit-k1-pcie-fix-256ffa8d382d
Best regards,
--
Encrow Thorne <encrow.thorne@linux.spacemit.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] PCI: spacemit: Ignore link partner PERST on K1
2026-09-24 2:04 [PATCH] PCI: spacemit: Ignore link partner PERST on K1 Encrow Thorne
@ 2026-09-24 2:23 ` Troy Mitchell
2026-11-05 2:53 ` Encrow Thorne
2026-10-18 4:26 ` Manivannan Sadhasivam
1 sibling, 1 reply; 5+ messages in thread
From: Troy Mitchell @ 2026-09-24 2:23 UTC (permalink / raw)
To: Encrow Thorne, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Yixun Lan,
Troy Mitchell
Cc: linux-pci, linux-riscv, spacemit, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 826 bytes --]
On Thu Sep 24, 2026 at 10:04 AM +08, Encrow Thorne wrote:
> The K1 PCIe controller and PHY are affected by the PERST signal from
> the link partner during initialization. With some devices connected,
> this can prevent host initialization from progressing and cause the
> system to hang while probing the PCIe controller.
>
> Set PCIE_IGNORE_PERSTN before accessing the DBI registers. When set,
> this bit makes both the PCIe controller and PHY ignore the PERST
> signal from the link partner.
>
> This allows host initialization to complete without being affected by
> the link partner's PERST state.
>
> Signed-off-by: Encrow Thorne <encrow.thorne@linux.spacemit.com>
Fix tag and reported-by tag [1]?
Link: https://lore.kernel.org/all/20260825052249.66921-1-bbanelli@gmail.com/ [1]
--
Troy Mitchell
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 248 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: spacemit: Ignore link partner PERST on K1
2026-09-24 2:23 ` Troy Mitchell
@ 2026-11-05 2:53 ` Encrow Thorne
0 siblings, 0 replies; 5+ messages in thread
From: Encrow Thorne @ 2026-11-05 2:53 UTC (permalink / raw)
To: Troy Mitchell, Encrow Thorne, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Bjorn Helgaas, Yixun Lan
Cc: linux-pci, linux-riscv, spacemit, linux-kernel
On Thu Sep 24, 2026 at 10:23 AM CST, Troy Mitchell wrote:
> On Thu Sep 24, 2026 at 10:04 AM +08, Encrow Thorne wrote:
>> The K1 PCIe controller and PHY are affected by the PERST signal from
>> the link partner during initialization. With some devices connected,
>> this can prevent host initialization from progressing and cause the
>> system to hang while probing the PCIe controller.
>>
>> Set PCIE_IGNORE_PERSTN before accessing the DBI registers. When set,
>> this bit makes both the PCIe controller and PHY ignore the PERST
>> signal from the link partner.
>>
>> This allows host initialization to complete without being affected by
>> the link partner's PERST state.
>>
>> Signed-off-by: Encrow Thorne <encrow.thorne@linux.spacemit.com>
> Fix tag and reported-by tag [1]?
>
> Link: https://lore.kernel.org/all/20260825052249.66921-1-bbanelli@gmail.com/ [1]
Thanks, I will add it in the next version.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: spacemit: Ignore link partner PERST on K1
2026-09-24 2:04 [PATCH] PCI: spacemit: Ignore link partner PERST on K1 Encrow Thorne
2026-09-24 2:23 ` Troy Mitchell
@ 2026-10-18 4:26 ` Manivannan Sadhasivam
2026-11-05 2:51 ` Encrow Thorne
1 sibling, 1 reply; 5+ messages in thread
From: Manivannan Sadhasivam @ 2026-10-18 4:26 UTC (permalink / raw)
To: Encrow Thorne
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Yixun Lan,
Troy Mitchell, linux-pci, linux-riscv, spacemit, linux-kernel
On 2026-09-24 10:04 +0800, Encrow Thorne wrote:
> The K1 PCIe controller and PHY are affected by the PERST signal from
> the link partner during initialization. With some devices connected,
> this can prevent host initialization from progressing and cause the
> system to hang while probing the PCIe controller.
>
> Set PCIE_IGNORE_PERSTN before accessing the DBI registers. When set,
> this bit makes both the PCIe controller and PHY ignore the PERST
> signal from the link partner.
>
> This allows host initialization to complete without being affected by
> the link partner's PERST state.
>
> Signed-off-by: Encrow Thorne <encrow.thorne@linux.spacemit.com>
> ---
> drivers/pci/controller/dwc/pcie-spacemit-k1.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-spacemit-k1.c b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> index 0564c46e2f48..98f067e1ba81 100644
> --- a/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> +++ b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> @@ -44,6 +44,7 @@
>
> #define PCIE_CONTROL_LOGIC 0x0004
> #define PCIE_SOFT_RESET BIT(0)
> +#define PCIE_IGNORE_PERSTN BIT(2)
>
> struct k1_pcie {
> struct dw_pcie pci;
> @@ -137,6 +138,13 @@ static int k1_pcie_init(struct dw_pcie_rp *pp)
> if (ret)
> return ret;
>
> + /*
> + * When set to 1, the PCIe controller and PHY ignore the PERST signal
> + * from the link partner in both RC and EP modes.
> + */
What? PERST# is an output signal to RC and input to Endpoint. PERST# is not
controlled by the Endpoint, but only by the RC/host.
- Mani
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] PCI: spacemit: Ignore link partner PERST on K1
2026-10-18 4:26 ` Manivannan Sadhasivam
@ 2026-11-05 2:51 ` Encrow Thorne
0 siblings, 0 replies; 5+ messages in thread
From: Encrow Thorne @ 2026-11-05 2:51 UTC (permalink / raw)
To: Manivannan Sadhasivam, Encrow Thorne
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Yixun Lan,
Troy Mitchell, linux-pci, linux-riscv, spacemit, linux-kernel
On Sun Oct 18, 2026 at 12:26 PM CST, Manivannan Sadhasivam wrote:
> On 2026-09-24 10:04 +0800, Encrow Thorne wrote:
>> The K1 PCIe controller and PHY are affected by the PERST signal from
>> the link partner during initialization. With some devices connected,
>> this can prevent host initialization from progressing and cause the
>> system to hang while probing the PCIe controller.
>>
>> Set PCIE_IGNORE_PERSTN before accessing the DBI registers. When set,
>> this bit makes both the PCIe controller and PHY ignore the PERST
>> signal from the link partner.
>>
>> This allows host initialization to complete without being affected by
>> the link partner's PERST state.
>>
>> Signed-off-by: Encrow Thorne <encrow.thorne@linux.spacemit.com>
>> ---
>> drivers/pci/controller/dwc/pcie-spacemit-k1.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/pci/controller/dwc/pcie-spacemit-k1.c b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
>> index 0564c46e2f48..98f067e1ba81 100644
>> --- a/drivers/pci/controller/dwc/pcie-spacemit-k1.c
>> +++ b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
>> @@ -44,6 +44,7 @@
>>
>> #define PCIE_CONTROL_LOGIC 0x0004
>> #define PCIE_SOFT_RESET BIT(0)
>> +#define PCIE_IGNORE_PERSTN BIT(2)
>>
>> struct k1_pcie {
>> struct dw_pcie pci;
>> @@ -137,6 +138,13 @@ static int k1_pcie_init(struct dw_pcie_rp *pp)
>> if (ret)
>> return ret;
>>
>> + /*
>> + * When set to 1, the PCIe controller and PHY ignore the PERST signal
>> + * from the link partner in both RC and EP modes.
>> + */
>
Hi Mani
> What? PERST# is an output signal to RC and input to Endpoint. PERST# is not
> controlled by the Endpoint, but only by the RC/host.
>
> - Mani
You are right; my earlier wording was misleading.
On K1, the PERST# pad input feeds back into the local controller's
internal reset input even in RC mode. Thus, the RC can reset itself
when asserting PERST# to reset the endpoint.
PCIE_IGNORE_PERSTN masks this input path without affecting the
RC's control of the external PERST# signal.
Regards,
Encrow Thorne
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-05 2:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 2:04 [PATCH] PCI: spacemit: Ignore link partner PERST on K1 Encrow Thorne
2026-09-24 2:23 ` Troy Mitchell
2026-11-05 2:53 ` Encrow Thorne
2026-10-18 4:26 ` Manivannan Sadhasivam
2026-11-05 2:51 ` Encrow Thorne
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®