Re: [PATCH v7 2/3] PCI: cadence: Add HPA IP debugfs for LTSSM status

From: Manivannan Sadhasivam

Date: Wed Jul 01 2026 - 01:20:09 EST


On Fri, Jun 12, 2026 at 12:59:32AM +0800, Hans Zhang wrote:
> Add debugfs support for HPA-based Cadence PCIe controllers. A new file
> 'ltssm_status' is created under debugfs, allowing users to read the
> current LTSSM state as a string and raw value.
>
> Signed-off-by: Hans Zhang <18255117159@xxxxxxx>

This patch doesn't apply cleanly on top of v7.2-rc1. Please rebase and resend
after incorporating below comments.

> ---
> Documentation/ABI/testing/debugfs-cdns-pcie | 5 +
> drivers/pci/controller/cadence/Kconfig | 9 +
> drivers/pci/controller/cadence/Makefile | 1 +
> drivers/pci/controller/cadence/pci-sky1.c | 4 +
> .../controller/cadence/pcie-cadence-debugfs.c | 211 ++++++++++++++++++
> .../cadence/pcie-cadence-host-hpa.c | 21 +-
> drivers/pci/controller/cadence/pcie-cadence.h | 153 +++++++++++++
> 7 files changed, 403 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/ABI/testing/debugfs-cdns-pcie
> create mode 100644 drivers/pci/controller/cadence/pcie-cadence-debugfs.c
>
> diff --git a/Documentation/ABI/testing/debugfs-cdns-pcie b/Documentation/ABI/testing/debugfs-cdns-pcie
> new file mode 100644
> index 000000000000..c1104e28e4ee
> --- /dev/null
> +++ b/Documentation/ABI/testing/debugfs-cdns-pcie
> @@ -0,0 +1,5 @@
> +What: /sys/kernel/debug/cdns_pcie_<dev>/ltssm_status
> +Date: March 2026

July 2026

> +Contact: Hans Zhang <18255117159@xxxxxxx>
> +Description: (RO) Read will return the current PCIe LTSSM state in both
> + string and raw value.
> \ No newline at end of file
> diff --git a/drivers/pci/controller/cadence/Kconfig b/drivers/pci/controller/cadence/Kconfig
> index 9e651d545973..cb010bc97aad 100644
> --- a/drivers/pci/controller/cadence/Kconfig
> +++ b/drivers/pci/controller/cadence/Kconfig
> @@ -6,6 +6,15 @@ menu "Cadence-based PCIe controllers"
> config PCIE_CADENCE
> tristate
>
> +config PCIE_CADENCE_DEBUGFS
> + tristate "Cadence PCIe debugfs entries"

As Sashiko pointed out, selecting PCIE_CADENCE_DEBUGFS as m and
PCIE_CADENCE_HOST as y will cause build error. You can just make
PCIE_CADENCE_DEBUGFS as 'bool' to avoid this issue.

- Mani

--
மணிவண்ணன் சதாசிவம்