[PW_SID:1062279] [v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform#1564
[PW_SID:1062279] [v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform#1564linux-riscv-bot wants to merge 1 commit into
Conversation
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 c214410 ("bnxt_en: Add TPH support in BNXT driver")
Fixes: d2e8a34 ("PCI/TPH: Add Steering Tag support")
Cc: stable@vger.kernel.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
|
Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform" |
PR for series 1062279 applied to workflow__riscv__fixes
Name: [v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1062279
Version: 3