From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: Chengwen Feng <fengchengwen@huawei.com>
Cc: <linux-pci@vger.kernel.org>, <bhelgaas@google.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>, Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, Sunil V L <sunilvl@ventanamicro.com>,
Mark Rutland <mark.rutland@arm.com>,
"Eric Van Tassell" <Eric.VanTassell@amd.com>,
Wei Huang <wei.huang2@amd.com>,
"Ajit Khaparde" <ajit.khaparde@broadcom.com>,
Andy Gospodarek <andrew.gospodarek@broadcom.com>,
<linux-acpi@vger.kernel.org>, <wangzhou1@hisilicon.com>,
<wanghuiqiang@huawei.com>, <liuyonglong@huawei.com>,
<stable@vger.kernel.org>, <jeremy.linton@arm.com>,
<sunilvl@oss.qualcomm.com>, <chenhuacai@loongson.cn>,
<wangliupu@loongson.cn>,
Somnath Kotur <somnath.kotur@broadcom.com>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<loongarch@lists.linux.dev>, <linux-riscv@lists.infradead.org>,
<linux-perf-users@vger.kernel.org>
Subject: Re: [PATCH v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform
Date: Fri, 6 Mar 2026 10:01:50 +0000 [thread overview]
Message-ID: <20260306100150.00003f38@huawei.com> (raw)
In-Reply-To: <20260306021920.23233-1-fengchengwen@huawei.com>
On Fri, 6 Mar 2026 10:19:17 +0800
Chengwen Feng <fengchengwen@huawei.com> wrote:
> Currently the pcie_tph_get_cpu_st() has an issue on ARM64 platform:
> 1. The pcie_tph_get_cpu_st() function directly uses cpu_uid as the input
> parameter to call the PCI ACPI DSM method. According to the DSM
> definition, the input value should be the ACPI Processor UID (see [1]
> for details).
> 2. In the Broadcom driver implementation [2] (which invokes
> pcie_tph_get_cpu_st()), cpu_uid is obtained via
> cpumask_first(irq->cpu_mask) - this is the logical CPU ID of a CPU
> core, generated and managed by kernel (e.g., [0,255] for a system
> with 256 logical CPU cores).
> 3. On ARM64 platforms, ACPI assigns Processor UID to cores listed in the
> MADT table, and this UID may not match the kernel's logical CPU ID.
> As a result, the current implementation fails to retrieve the correct
> CPU steer-tag in such cases.
> 4. The function works on AMD x86 platforms only because the logical CPU
> ID is identical to the ACPI Processor UID on those systems.
>
> This commit fixes it by:
> 1. For ACPI-enabled platforms, unify the CPU ACPI ID retrieval
> interface:
> - On arm64/riscv/loongarch: Rename existing get_acpi_id_for_cpu() to
> acpi_get_cpu_acpi_id().
> - On x86: Add new acpi_get_cpu_acpi_id() implementation that wraps
> cpu_acpi_id().
> 2. Update pcie_tph_get_cpu_st() to use acpi_get_cpu_acpi_id(cpu) to get
> valid ACPI Processor UID for DSM calls.
> 3. Renaming pcie_tph_get_cpu_st()'s input parameter cpu_uid to cpu for
> clarity, as the parameter now represents a logical CPU ID (not a
> UID).
>
> [1] According to ECN_TPH-ST_Revision_20200924
> (https://members.pcisig.com/wg/PCI-SIG/document/15470), the input
> is defined as: "If the target is a processor, then this field
> represents the ACPI Processor UID of the processor as specified in
> the MADT. If the target is a processor container, then this field
> represents the ACPI Processor UID of the processor container as
> specified in the PPTT."
> [2] commit c214410c47d6e ("bnxt_en: Add TPH support in BNXT driver")
>
> Fixes: d2e8a34876ce ("PCI/TPH: Add Steering Tag support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
>
> ---
> Changes in v3:
> - Rename existing get_acpi_id_for_cpu() to acpi_get_cpu_acpi_id() other
> than add one new API.
Ah. I wasn't clear around that rename suggestion. Split this into two patches.
1) Rename
2) The new stuff plus x86 implementation.
>
> Changes in v2:
> - Add ECN _DSM reference doc name and its URL.
> - Separate implement acpi_get_cpu_acpi_id() in each arch which supports
> ACPI.
> - Refine commit-log.
>
> ---
> Documentation/PCI/tph.rst | 4 ++--
> arch/arm64/include/asm/acpi.h | 4 ++--
> arch/loongarch/include/asm/acpi.h | 2 +-
> arch/riscv/include/asm/acpi.h | 2 +-
> arch/riscv/kernel/acpi_numa.c | 2 +-
> arch/x86/include/asm/acpi.h | 2 ++
> arch/x86/kernel/cpu/common.c | 8 ++++++++
> drivers/acpi/pptt.c | 16 ++++++++--------
> drivers/acpi/riscv/rhct.c | 2 +-
> drivers/pci/tph.c | 11 ++++++-----
> drivers/perf/arm_cspmu/arm_cspmu.c | 2 +-
> include/linux/pci-tph.h | 4 ++--
> 12 files changed, 35 insertions(+), 24 deletions(-)
next prev parent reply other threads:[~2026-03-06 10:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 0:36 [PATCH] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform Chengwen Feng
2026-03-03 19:02 ` Bjorn Helgaas
2026-03-04 9:28 ` fengchengwen
2026-03-04 15:38 ` Bjorn Helgaas
2026-03-05 8:40 ` fengchengwen
2026-03-04 13:50 ` kernel test robot
2026-03-04 23:18 ` kernel test robot
2026-03-05 0:02 ` kernel test robot
2026-03-05 1:29 ` kernel test robot
2026-03-05 8:36 ` [PATCH v2] " Chengwen Feng
2026-03-05 8:53 ` Huacai Chen
2026-03-05 9:07 ` fengchengwen
2026-03-05 14:54 ` Jonathan Cameron
2026-03-06 2:20 ` fengchengwen
2026-03-06 2:19 ` [PATCH v3] " Chengwen Feng
2026-03-06 10:01 ` Jonathan Cameron [this message]
2026-03-09 4:18 ` fengchengwen
2026-03-09 4:16 ` [PATCH v4 0/2] " Chengwen Feng
2026-03-09 4:16 ` [PATCH v4 1/2] ACPI: Rename get_acpi_id_for_cpu() to acpi_get_cpu_acpi_id() on non-x86 Chengwen Feng
2026-03-09 10:30 ` Jonathan Cameron
2026-03-09 13:29 ` Huacai Chen
2026-03-10 3:29 ` fengchengwen
2026-03-09 4:16 ` [PATCH v4 2/2] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform Chengwen Feng
2026-03-09 10:59 ` Jonathan Cameron
2026-03-09 10:28 ` [PATCH v4 0/2] " Jonathan Cameron
2026-03-10 3:26 ` fengchengwen
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=20260306100150.00003f38@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=Eric.VanTassell@amd.com \
--cc=ajit.khaparde@broadcom.com \
--cc=alex@ghiti.fr \
--cc=andrew.gospodarek@broadcom.com \
--cc=aou@eecs.berkeley.edu \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=fengchengwen@huawei.com \
--cc=hpa@zytor.com \
--cc=jeremy.linton@arm.com \
--cc=kernel@xen0n.name \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=liuyonglong@huawei.com \
--cc=loongarch@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rafael@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=somnath.kotur@broadcom.com \
--cc=stable@vger.kernel.org \
--cc=sunilvl@oss.qualcomm.com \
--cc=sunilvl@ventanamicro.com \
--cc=tglx@kernel.org \
--cc=wanghuiqiang@huawei.com \
--cc=wangliupu@loongson.cn \
--cc=wangzhou1@hisilicon.com \
--cc=wei.huang2@amd.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/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