From: sashiko-bot@kernel.org
To: "Chengwen Feng" <fengchengwen@huawei.com>
Cc: kvm@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v21 08/13] PCI/TPH: Add pci_tph_dsm_supported() helper to detect device TPH ST _DSM
Date: Wed, 18 Nov 2026 10:29:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-220692@kernel.org> (raw)
In-Reply-To: <20261118091238.45992-9-fengchengwen@huawei.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Low] PCI/TPH: commit message names pci_tph_dsm_supported() instead of
pcie_*
- [Low] PCI/TPH: missing colon after Return in pcie_tph_dsm_supported()
kernel-doc
- [Low] PCI/TPH: duplicated _DSM check and unused helper in
pcie_tph_dsm_supported()
--
commit 04c9ebfe20073a30540b5afa000403cf34aaeb34
Author: Chengwen Feng <fengchengwen@huawei.com>
> PCI/TPH: Add pci_tph_dsm_supported() helper to detect device TPH ST _DSM
>
> Add new helper pci_tph_dsm_supported() to check whether the root port
> of a given PCI device exposes the TPH ST ACPI _DSM method.
[Severity: Low]
The commit subject and message refer to pci_tph_dsm_supported(), whereas
the function defined and exported by the patch is pcie_tph_dsm_supported().
> diff --git a/drivers/pci/tph.c b/drivers/pci/tph.c
> index c8b867dd233d4..c3d940745fe4d 100644
> --- a/drivers/pci/tph.c
> +++ b/drivers/pci/tph.c
> @@ -587,3 +587,31 @@ void pci_tph_init(struct pci_dev *pdev)
> save_size = sizeof(u32) + num_entries * sizeof(u16);
> pci_add_ext_cap_save_buffer(pdev, PCI_EXT_CAP_ID_TPH, save_size);
> }
> +
> +/**
> + * pcie_tph_dsm_supported - Check if root port exposes TPH ST _DSM
> + * @pdev: target PCI device
> + *
> + * Return true if root port of @pdev provides TPH ST DSM function,
> + * false otherwise (ACPI disabled or DSM missing).
> + */
[Severity: Low]
Return is missing a trailing colon ("Return:"), which causes kernel-doc to
warn that no description was found for the return value of
pcie_tph_dsm_supported().
> +bool pcie_tph_dsm_supported(struct pci_dev *pdev)
> +{
> +#ifdef CONFIG_ACPI
> + struct pci_dev *rp = pcie_find_root_port(pdev);
> + acpi_handle handle;
> +
> + if (!rp || !rp->bus || !rp->bus->bridge)
> + return false;
> +
> + handle = ACPI_HANDLE(rp->bus->bridge);
> + if (!handle)
> + return false;
> +
> + return acpi_check_dsm(handle, &pci_acpi_dsm_guid, 7,
> + BIT(TPH_ST_DSM_FUNC_INDEX));
> +#else
> + return false;
> +#endif
> +}
> +EXPORT_SYMBOL_GPL(pcie_tph_dsm_supported);
[Severity: Low]
Could pcie_tph_get_cpu_st_ext() and tph_invoke_dsm() share a helper with
pcie_tph_dsm_supported() instead of duplicating the Root Port ACPI handle
lookup and acpi_check_dsm() call?
Sharing the lookup would also avoid pcie_tph_get_cpu_st_ext() passing a
NULL rp_acpi_handle to tph_invoke_dsm() -> acpi_evaluate_object(), which
logs an acpi_handle_warn() on AE_BAD_PARAMETER when the Root Port bridge
has no ACPI companion.
In addition, none of the follow-up VFIO patches in this series call
pcie_tph_dsm_supported(), leaving the exported helper unused in-tree.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118091238.45992-1-fengchengwen@huawei.com?part=8
next prev parent reply other threads:[~2026-11-18 10:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 9:12 [PATCH v21 00/13] vfio/pci: Add PCIe TPH support Chengwen Feng
2026-11-18 9:12 ` [PATCH v21 01/13] PCI/TPH: Fix pcie_tph_get_st_table_loc() field extraction Chengwen Feng
2026-11-18 9:29 ` sashiko-bot
2026-11-18 9:12 ` [PATCH v21 02/13] PCI/TPH: Fix tph_enabled concurrent update race by bitfield packing Chengwen Feng
2026-11-18 9:38 ` sashiko-bot
2026-11-18 9:12 ` [PATCH v21 03/13] PCI/TPH: Cache negotiated max requester type at probe time Chengwen Feng
2026-11-18 9:12 ` [PATCH v21 04/13] PCI/TPH: Refactor pcie_enable_tph and add requester variant Chengwen Feng
2026-11-18 9:12 ` [PATCH v21 05/13] PCI/TPH: Refactor pcie_tph_get_cpu_st & " Chengwen Feng
2026-11-18 9:12 ` [PATCH v21 06/13] PCI/TPH: Add macros to check standard and extended TPH support Chengwen Feng
2026-11-18 10:06 ` sashiko-bot
2026-11-18 9:12 ` [PATCH v21 07/13] PCI/TPH: Add pcie_tph_set_st_entries() batch ST entry programming helper Chengwen Feng
2026-11-18 10:15 ` sashiko-bot
2026-11-18 9:12 ` [PATCH v21 08/13] PCI/TPH: Add pci_tph_dsm_supported() helper to detect device TPH ST _DSM Chengwen Feng
2026-11-18 10:29 ` sashiko-bot [this message]
2026-11-18 9:12 ` [PATCH v21 09/13] vfio/pci: Add basic NO-ST TPH VFIO device feature support Chengwen Feng
2026-11-18 9:12 ` [PATCH v21 10/13] vfio/pci: Add IV-ST TPH policy and TPH_PROGRAM batch programming support Chengwen Feng
2026-11-18 9:12 ` [PATCH v21 11/13] vfio/pci: Add DS-ST TPH policy and TPH_RESOLVE capability Chengwen Feng
2026-11-18 9:12 ` [PATCH v21 12/13] vfio/pci: Reset PCIe TPH state on device open and close Chengwen Feng
2026-11-18 9:12 ` [PATCH v21 13/13] vfio/pci: Expose per-device TPH state via debugfs Chengwen Feng
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=sashiko-outbox-220692@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=fengchengwen@huawei.com \
--cc=kvm@vger.kernel.org \
--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