All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hans Zhang" <18255117159@163.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v5 2/3] PCI: cadence: Add HPA IP debugfs for LTSSM status
Date: Fri, 15 May 2026 15:39:12 +0000	[thread overview]
Message-ID: <20260515153913.257A8C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260515145747.129635-3-18255117159@163.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The PCIE_CADENCE_DEBUGFS Kconfig option is defined as a tristate but checked using #ifdef, causing silently disabled debugfs features when built as a module.
--

commit 42a8fcd88891f03bce5c72c19d8d785ffffc51ae
Author: Hans Zhang <18255117159@163.com>

PCI: cadence: Add HPA IP debugfs for LTSSM status

This commit adds debugfs support for HPA-based Cadence PCIe controllers
to allow reading the current LTSSM state as a string and raw value.

> diff --git a/drivers/pci/controller/cadence/Kconfig b/drivers/pci/controller/cadence/Kconfig
> index 9e651d5459735..cb010bc97aad3 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"

Should this be a bool instead of a tristate?

[ ... ]

> diff --git a/drivers/pci/controller/cadence/pcie-cadence.h b/drivers/pci/controller/cadence/pcie-cadence.h
> index 9a464cbaf073d..2320319af83bc 100644
> --- a/drivers/pci/controller/cadence/pcie-cadence.h
> +++ b/drivers/pci/controller/cadence/pcie-cadence.h

[ ... ]

> +#ifdef CONFIG_PCIE_CADENCE_DEBUGFS
> +void cdns_pcie_debugfs_deinit(struct cdns_pcie *pci);
> +void cdns_pcie_debugfs_init(struct cdns_pcie *pci);
> +#else
> +static inline void cdns_pcie_debugfs_deinit(struct cdns_pcie *pci)
> +{
> +}
> +static inline void cdns_pcie_debugfs_init(struct cdns_pcie *pci)
> +{
> +}
> +#endif

When configured as a module (=m), Kbuild defines
CONFIG_PCIE_CADENCE_DEBUGFS_MODULE instead of CONFIG_PCIE_CADENCE_DEBUGFS.
Does this #ifdef evaluate to false and silently use the dummy stubs instead
of initializing the debugfs features?

If this were fixed to use IS_ENABLED(), could it introduce linker errors
when the host driver is built-in (=y) but debugfs is built as a module (=m)?
Changing the Kconfig definition to bool would avoid this.

[ ... ]

> diff --git a/drivers/pci/controller/cadence/pcie-cadence-debugfs.c b/drivers/pci/controller/cadence/pcie-cadence-debugfs.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/pci/controller/cadence/pcie-cadence-debugfs.c

[ ... ]

> +void cdns_pcie_debugfs_init(struct cdns_pcie *pci)
> +{
> +	char dirname[CDNS_DEBUGFS_BUF_MAX];
> +	struct device *dev = pci->dev;
> +
> +	/* Create main directory for each platform driver. */
> +	snprintf(dirname, CDNS_DEBUGFS_BUF_MAX, "cdns_pcie_%s", dev_name(dev));
> +	pci->debug_dir = debugfs_create_dir(dirname, NULL);
> +
> +	cdns_pcie_ltssm_debugfs_init(pci, pci->debug_dir);
> +}
> +EXPORT_SYMBOL_GPL(cdns_pcie_debugfs_init);

Since this file can currently be built as a module, does it need a
MODULE_LICENSE() declaration? Without it, loading the module might fail
when trying to use GPL-only exported symbols like debugfs_create_dir().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260515145747.129635-1-18255117159@163.com?part=2

  reply	other threads:[~2026-05-15 15:39 UTC|newest]

Thread overview: 6+ 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 [this message]
2026-05-15 14:57 ` [PATCH v5 3/3] PCI: cadence: Add LGA " Hans Zhang
2026-05-15 15:57   ` sashiko-bot

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=20260515153913.257A8C2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=18255117159@163.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.