]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI/TPH: Pass ACPI Processor UID to Cache Locality _DSM
authorChengwen Feng <fengchengwen@huawei.com>
Wed, 1 Apr 2026 08:16:40 +0000 (16:16 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 6 Apr 2026 14:55:16 +0000 (16:55 +0200)
commitabdd2a86535b59c76d14da2547160bc83e059c03
tree8c3dfd7261824828c9676c5012d241d128c1eaea
parenta7034e9e4491573d268126a5e6991b83e95db560
PCI/TPH: Pass ACPI Processor UID to Cache Locality _DSM

pcie_tph_get_cpu_st() uses the Query Cache Locality Features _DSM [1]
to retrieve the TPH Steering Tag for memory associated with the CPU
identified by its "cpu_uid" parameter, a Linux logical CPU ID.

The _DSM requires an ACPI Processor UID, which pcie_tph_get_cpu_st()
previously assumed was the same as the Linux logical CPU ID. This is
true on x86 but not on arm64, so pcie_tph_get_cpu_st() returned the
wrong Steering Tag, resulting in incorrect TPH functionality on arm64.

Convert the Linux logical CPU ID to the ACPI Processor UID with
acpi_get_cpu_uid() before passing it to the _DSM. Additionally, rename
the pcie_tph_get_cpu_st() parameter from "cpu_uid" to "cpu" to reflect
that it represents a logical CPU ID (not an ACPI Processor 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."

Fixes: d2e8a34876ce ("PCI/TPH: Add Steering Tag support")
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260401081640.26875-9-fengchengwen@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Documentation/PCI/tph.rst
drivers/pci/tph.c
include/linux/pci-tph.h