From: sashiko-bot@kernel.org
To: "Hans Zhang" <18255117159@163.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v7 2/3] PCI: cadence: Add HPA IP debugfs for LTSSM status
Date: Thu, 11 Jun 2026 17:22:40 +0000 [thread overview]
Message-ID: <20260611172240.CC6D01F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260611165933.20071-3-18255117159@163.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Building PCIE_CADENCE_HOST as built-in and PCIE_CADENCE_DEBUGFS as a module results in a linkage error.
--
commit 20cc8aa0f1ba6b094082684b8473490c278a0462
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.
It creates a new ltssm_status file under debugfs to allow users to read
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"
> + depends on DEBUG_FS
> + depends on PCIE_CADENCE_HOST || PCIE_CADENCE_EP
[ ... ]
> diff --git a/drivers/pci/controller/cadence/pcie-cadence.h b/drivers/pci/controller/cadence/pcie-cadence.h
> index 9a464cbaf073d..8de2924057659 100644
> --- a/drivers/pci/controller/cadence/pcie-cadence.h
> +++ b/drivers/pci/controller/cadence/pcie-cadence.h
[ ... ]
> @@ -535,4 +676,16 @@ bool cdns_pcie_hpa_link_up(struct cdns_pcie *pcie);
>
> extern const struct dev_pm_ops cdns_pcie_pm_ops;
>
> +#if IS_ENABLED(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
[Severity: Low]
Does this cause a linkage error if CONFIG_PCIE_CADENCE_HOST is built-in (=y)
and CONFIG_PCIE_CADENCE_DEBUGFS is built as a module (=m)?
When configured this way, IS_ENABLED(CONFIG_PCIE_CADENCE_DEBUGFS) evaluates
to 1, so the preprocessor does not provide the empty inline stubs. Then,
when the built-in host code calls cdns_pcie_debugfs_init(), it results in
an undefined reference at vmlinux link time because the debugfs code is in
a separate module.
Would using IS_REACHABLE() instead of IS_ENABLED(), or restricting the
tristate dependencies in Kconfig, prevent this build failure?
> diff --git a/drivers/pci/controller/cadence/pcie-cadence-host-hpa.c b/drivers/pci/controller/cadence/pcie-cadence-host-hpa.c
> index 0f540bed58e88..89f1d75c2c38d 100644
> --- a/drivers/pci/controller/cadence/pcie-cadence-host-hpa.c
> +++ b/drivers/pci/controller/cadence/pcie-cadence-host-hpa.c
[ ... ]
> @@ -360,7 +373,13 @@ int cdns_pcie_hpa_host_setup(struct cdns_pcie_rc *rc)
> if (!bridge->ops)
> bridge->ops = &cdns_pcie_hpa_host_ops;
>
> - return pci_host_probe(bridge);
> + ret = pci_host_probe(bridge);
> + if (ret)
> + return ret;
> +
> + cdns_pcie_debugfs_init(pcie);
> +
> + return 0;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260611165933.20071-1-18255117159@163.com?part=2
next prev parent reply other threads:[~2026-06-11 17:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 16:59 [PATCH v7 0/3] PCI: cadence: Add LTSSM debugfs Hans Zhang
2026-06-11 16:59 ` [PATCH v7 1/3] PCI: cadence: Add HPA architecture flag Hans Zhang
2026-06-11 17:09 ` sashiko-bot
2026-06-11 16:59 ` [PATCH v7 2/3] PCI: cadence: Add HPA IP debugfs for LTSSM status Hans Zhang
2026-06-11 17:22 ` sashiko-bot [this message]
2026-06-11 16:59 ` [PATCH v7 3/3] PCI: cadence: Add LGA " Hans Zhang
2026-06-11 17:35 ` sashiko-bot
2026-06-12 9:30 ` [PATCH v7 0/3] PCI: cadence: Add LTSSM debugfs Aksh Garg
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=20260611172240.CC6D01F00893@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox