public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* RFC about how to obtain PCIE TPH steer-tag on ARM64 platform
@ 2026-01-12  3:01 fengchengwen
  2026-01-13 19:07 ` Bjorn Helgaas
  0 siblings, 1 reply; 11+ messages in thread
From: fengchengwen @ 2026-01-12  3:01 UTC (permalink / raw)
  To: linux-pci
  Cc: Wei, Eric.VanTassell, bhelgaas, jonathan.cameron, wangzhou1,
	wanghuiqiang, liuyonglong

Hi all,

We want to enable PCIE TPH feature on ARM64 platform, but we encounter the
following problem:
1. The pcie_tph_get_cpu_st() function invokes the ACPI DSM method to obtain
   the steer-tag of the CPU. According to the definition of the DSM method [1],
   the cpu_uid should be "ACPI processor uid".
2. In the current implementation, the ACPI DSM method is invoked directly using
   the logical core number, which works on the x86 platform but does not work
   on the ARM64 platform because the logical core ID is not the same as the
   ACPI processor ID when the PG exists.


Because the ARM64 platform generates steer-tag based on the MPIDR information
(at least for the Kunpeng platform). Therefore, we have two option:
Option-1: convert logic core ID to ACPI process ID: use get_acpi_id_for_cpu()
          to get ACPI process ID in pcie_tph_get_cpu_st() before invoke dsm [2],
          and BIOS/ACPI use process ID to get corresponding MPIDR, and then
          generate steer-tag from MPIDR.
Option-2: convert logic core ID to MPIDR: use cpu_logical_map() to get MPIDR
          in pcie_tph_get_cpu_st() before invoke dsm, and BIOS/ACPI use it
          to generate steer-tag directly.

Option-1 complies with _DSM ECN, but requires BIOS/ACPI to maintain a mapping
table from acpi_process_id to MPIDR.
Option 2 does not comply with _DSM ECN (if extension is required). But it is easy
to implement and can be extended to the DT system (ACPI is not supported) I think.


Hope for your feedback.

With best regards,
Chengwen


[1] According to _DSM ECN, 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] git diff about /drivers/pci/tph.c
@@ -289,6 +289,9 @@ int pcie_tph_get_cpu_st(struct pci_dev *pdev, enum tph_mem_type mem_type,

        rp_acpi_handle = ACPI_HANDLE(rp->bus->bridge);

+#ifdef CONFIG_ARM64
+       cpu_uid = get_acpi_id_for_cpu(cpu_uid);
+#endif
        if (tph_invoke_dsm(rp_acpi_handle, cpu_uid, &info) != AE_OK) {
                *tag = 0;
                return -EINVAL;



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-01-19  0:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-12  3:01 RFC about how to obtain PCIE TPH steer-tag on ARM64 platform fengchengwen
2026-01-13 19:07 ` Bjorn Helgaas
2026-01-13 22:38   ` Wei Huang
2026-01-14  3:52     ` fengchengwen
2026-01-14 16:36       ` Wei Huang
2026-01-16  0:14         ` fengchengwen
2026-01-14  3:39   ` fengchengwen
2026-01-14 17:03     ` Bjorn Helgaas
2026-01-16  0:21       ` fengchengwen
2026-01-16 19:32         ` Bjorn Helgaas
2026-01-19  0:17           ` fengchengwen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox