Skip to content

[PW_SID:1062279] [v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform#1564

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1062279
Closed

[PW_SID:1062279] [v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform#1564
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1062279

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

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

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>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.45 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1375.42 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2036.00 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.57 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 4.08 seconds
Result: WARNING
Output:

CHECK: Consider using #include <linux/acpi.h> instead of <asm/acpi.h>
#163: FILE: arch/x86/kernel/cpu/common.c:32:
+#include <asm/acpi.h>

CHECK: Consider using #include <linux/smp.h> instead of <asm/smp.h>
#171: FILE: arch/x86/kernel/cpu/common.c:61:
+#include <asm/smp.h>

total: 0 errors, 0 warnings, 2 checks, 212 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit c81e225157d1 ("PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 2 checks, 212 lines checked
CHECK: Consider using #include <linux/acpi.h> instead of <asm/acpi.h>
CHECK: Consider using #include <linux/smp.h> instead of <asm/smp.h>


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 85.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
kdoc
Desc: Detects for kdoc errors
Duration: 0.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
module-param
Desc: Detect module_param changes
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1062279 branch March 13, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants