Linux-PCI Archive mirror
 help / color / mirror / Atom feed
From: Aksh Garg <a-garg7@ti.com>
To: Hans Zhang <18255117159@163.com>, <bhelgaas@google.com>,
	<lpieralisi@kernel.org>, <kwilczynski@kernel.org>,
	<mani@kernel.org>, <hans.zhang@cixtech.com>
Cc: <robh@kernel.org>, <mpillai@cadence.com>, <s-vadapalli@ti.com>,
	<linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 3/3] PCI: cadence: Add LGA IP debugfs for LTSSM status
Date: Tue, 19 May 2026 11:11:01 +0530	[thread overview]
Message-ID: <1bd033f4-a695-4266-aca3-1e034a161c3e@ti.com> (raw)
In-Reply-To: <20260515145747.129635-4-18255117159@163.com>



On 15/05/26 20:27, Hans Zhang wrote:
> Extend debugfs support to LGA-based Cadence PCIe controllers. The
> 'ltssm_status' file now works for both HPA and LGA IP by selecting the
> appropriate register access based on the 'is_hpa' flag.
> 
> Signed-off-by: Hans Zhang <18255117159@163.com>
> ---
> Hi Aksh
> 
> Could you please assist in checking whether the ltssm_status of LGA is
> correct? If there are any inaccuracies, please point them out.
> ---
>   .../controller/cadence/pcie-cadence-debugfs.c | 61 ++++++++++++++++++-
>   .../pci/controller/cadence/pcie-cadence-ep.c  |  3 +
>   .../controller/cadence/pcie-cadence-host.c    |  9 ++-
>   drivers/pci/controller/cadence/pcie-cadence.h | 43 +++++++++++++
>   4 files changed, 112 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/controller/cadence/pcie-cadence-debugfs.c b/drivers/pci/controller/cadence/pcie-cadence-debugfs.c
> index 97c5deef2b1a..ac985699b974 100644
> --- a/drivers/pci/controller/cadence/pcie-cadence-debugfs.c
> +++ b/drivers/pci/controller/cadence/pcie-cadence-debugfs.c
> @@ -13,6 +13,58 @@
>   
>   #define CDNS_DEBUGFS_BUF_MAX		128
>   
> +static const char *cdns_pcie_lga_ltssm_status_string(enum cdns_pcie_lga_ltssm ltssm)
> +{
> +	const char *str;
> +
> +	switch (ltssm) {
> +#define CDNS_PCIE_LGA_LTSSM_NAME(n) case n: str = #n; break
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_DETECT_QUIET);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_DETECT_ACTIVE);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_POLLING_ACTIVE);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_POLLING_COMPLIANCE);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_POLLING_CONFIGURATION);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_CONFIGURATION_LINKWIDTH_START);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_CONFIGURATION_LINKWIDTH_ACCEPT);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_CONFIGURATION_LANENUM_ACCEPT);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_CONFIGURATION_LANENUM_WAIT);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_CONFIGURATION_COMPLETE);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_CONFIGURATION_IDLE);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_RECOVERY_RCVRLOCK);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_RECOVERY_SPEED);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_RECOVERY_RCVRCFG);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_RECOVERY_IDLE);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_L0);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_RX_L0S_ENTRY);
> +	CDNS_P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ME(CDNS_PCIE_LGA_RECOVERY_EQUALIZATION_PHASE_1);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_RECOVERY_EQUALIZATION_PHASE_2);
> +	CDNS_PCIE_LGA_LTSSM_NAME(CDNS_PCIE_LGA_RECOVERY_EQUALIZATION_PHASE_3);

Hi Hans,

You might need to rename the states as CDNS_PCIE_LGA_LTSSM_* as
suggested by Sashiko to print the state names correctly, and also to
complement the naming used for HPA LTSSM states.

> +	default:
> +		str = "CDNS_PCIE_LGA_LTSSM_UNKNOWN";
> +		break;
> +	}
> +
> +	return str + strlen("CDNS_PCIE_LGA_LTSSM_");

I have tested for LGA IP by updating this to strlen("CDNS_PCIE_LGA_").
The state encodings looks good to me.

Regards,
Aksh Garg


  parent reply	other threads:[~2026-05-19  5:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15 14:57 [PATCH v5 0/3] PCI: cadence: Add LTSSM debugfs Hans Zhang
2026-05-15 14:57 ` [PATCH v5 1/3] PCI: cadence: Add HPA architecture flag Hans Zhang
2026-05-15 14:57 ` [PATCH v5 2/3] PCI: cadence: Add HPA IP debugfs for LTSSM status Hans Zhang
2026-05-15 15:39   ` sashiko-bot
2026-05-15 14:57 ` [PATCH v5 3/3] PCI: cadence: Add LGA " Hans Zhang
2026-05-15 15:57   ` sashiko-bot
2026-05-19  5:41   ` Aksh Garg [this message]
2026-05-19 12:23     ` Hans Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bd033f4-a695-4266-aca3-1e034a161c3e@ti.com \
    --to=a-garg7@ti.com \
    --cc=18255117159@163.com \
    --cc=bhelgaas@google.com \
    --cc=hans.zhang@cixtech.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=mpillai@cadence.com \
    --cc=robh@kernel.org \
    --cc=s-vadapalli@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).