mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: fengchengwen <fengchengwen@huawei.com>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: <linux-pci@vger.kernel.org>, <bhelgaas@google.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@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>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Sunil V L <sunilvl@ventanamicro.com>,
	Mark Rutland <mark.rutland@arm.com>, <linux-acpi@vger.kernel.org>,
	<wei.huang2@amd.com>, <Eric.VanTassell@amd.com>,
	<jonathan.cameron@huawei.com>, <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>, <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <loongarch@lists.linux.dev>,
	<linux-riscv@lists.infradead.org>,
	<linux-perf-users@vger.kernel.org>
Subject: Re: [PATCH v4 1/2] ACPI: Rename get_acpi_id_for_cpu() to acpi_get_cpu_acpi_id() on non-x86
Date: Tue, 10 Mar 2026 11:29:33 +0800	[thread overview]
Message-ID: <9d0d4685-fe6b-4ffd-b9bd-6a560c0d7c9f@huawei.com> (raw)
In-Reply-To: <CAAhV-H7Cy1OuReaoGotZvdvHWLic_ECESFVZgbvNpk2HVjPjuw@mail.gmail.com>

Hi Huacai,

On 3/9/2026 9:29 PM, Huacai Chen wrote:
> Hi, Chengwen,
> 
> On Mon, Mar 9, 2026 at 12:17 PM Chengwen Feng <fengchengwen@huawei.com> wrote:
>>
>> To unify the CPU ACPI ID retrieval interface across architectures,
>> rename the existing get_acpi_id_for_cpu() function to
>> acpi_get_cpu_acpi_id() on arm64/riscv/loongarch platforms.
> Can we also rename cpu_acpi_id() to acpi_get_cpu_acpi_id() for x86?

Remove cpu_acpi_id() would make it look more concise, this was done in v5, thanks.

> 
> Huacai
> 
>>
>> This is a pure rename with no functional change, preparing for a
>> consistent ACPI Processor UID retrieval interface across all ACPI-enabled
>> platforms.
>>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
>> ---
>>  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 +-
>>  drivers/acpi/pptt.c                | 16 ++++++++--------
>>  drivers/acpi/riscv/rhct.c          |  2 +-
>>  drivers/perf/arm_cspmu/arm_cspmu.c |  2 +-
>>  7 files changed, 15 insertions(+), 15 deletions(-)
>>
>> diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
>> index c07a58b96329..202107aeb05b 100644
>> --- a/arch/arm64/include/asm/acpi.h
>> +++ b/arch/arm64/include/asm/acpi.h
>> @@ -114,7 +114,7 @@ static inline bool acpi_has_cpu_in_madt(void)
>>  }
>>
>>  struct acpi_madt_generic_interrupt *acpi_cpu_get_madt_gicc(int cpu);
>> -static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
>> +static inline u32 acpi_get_cpu_acpi_id(unsigned int cpu)
>>  {
>>         return  acpi_cpu_get_madt_gicc(cpu)->uid;
>>  }
>> @@ -125,7 +125,7 @@ static inline int get_cpu_for_acpi_id(u32 uid)
>>
>>         for (cpu = 0; cpu < nr_cpu_ids; cpu++)
>>                 if (acpi_cpu_get_madt_gicc(cpu) &&
>> -                   uid == get_acpi_id_for_cpu(cpu))
>> +                   uid == acpi_get_cpu_acpi_id(cpu))
>>                         return cpu;
>>
>>         return -EINVAL;
>> diff --git a/arch/loongarch/include/asm/acpi.h b/arch/loongarch/include/asm/acpi.h
>> index 7376840fa9f7..89c6c8f52cc3 100644
>> --- a/arch/loongarch/include/asm/acpi.h
>> +++ b/arch/loongarch/include/asm/acpi.h
>> @@ -40,7 +40,7 @@ extern struct acpi_madt_core_pic acpi_core_pic[MAX_CORE_PIC];
>>
>>  extern int __init parse_acpi_topology(void);
>>
>> -static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
>> +static inline u32 acpi_get_cpu_acpi_id(unsigned int cpu)
>>  {
>>         return acpi_core_pic[cpu_logical_map(cpu)].processor_id;
>>  }
>> diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h
>> index 6e13695120bc..1d23681b61b5 100644
>> --- a/arch/riscv/include/asm/acpi.h
>> +++ b/arch/riscv/include/asm/acpi.h
>> @@ -61,7 +61,7 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) { }
>>
>>  void acpi_init_rintc_map(void);
>>  struct acpi_madt_rintc *acpi_cpu_get_madt_rintc(int cpu);
>> -static inline u32 get_acpi_id_for_cpu(int cpu)
>> +static inline u32 acpi_get_cpu_acpi_id(int cpu)
>>  {
>>         return acpi_cpu_get_madt_rintc(cpu)->uid;
>>  }
>> diff --git a/arch/riscv/kernel/acpi_numa.c b/arch/riscv/kernel/acpi_numa.c
>> index 130769e3a99c..c2eb4824d0f7 100644
>> --- a/arch/riscv/kernel/acpi_numa.c
>> +++ b/arch/riscv/kernel/acpi_numa.c
>> @@ -40,7 +40,7 @@ static inline int get_cpu_for_acpi_id(u32 uid)
>>         int cpu;
>>
>>         for (cpu = 0; cpu < nr_cpu_ids; cpu++)
>> -               if (uid == get_acpi_id_for_cpu(cpu))
>> +               if (uid == acpi_get_cpu_acpi_id(cpu))
>>                         return cpu;
>>
>>         return -EINVAL;
>> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
>> index de5f8c018333..c1a8fba4c2b2 100644
>> --- a/drivers/acpi/pptt.c
>> +++ b/drivers/acpi/pptt.c
>> @@ -459,7 +459,7 @@ static void cache_setup_acpi_cpu(struct acpi_table_header *table,
>>  {
>>         struct acpi_pptt_cache *found_cache;
>>         struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
>> -       u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
>> +       u32 acpi_cpu_id = acpi_get_cpu_acpi_id(cpu);
>>         struct cacheinfo *this_leaf;
>>         unsigned int index = 0;
>>         struct acpi_pptt_processor *cpu_node = NULL;
>> @@ -546,7 +546,7 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
>>                                      unsigned int cpu, int level, int flag)
>>  {
>>         struct acpi_pptt_processor *cpu_node;
>> -       u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
>> +       u32 acpi_cpu_id = acpi_get_cpu_acpi_id(cpu);
>>
>>         cpu_node = acpi_find_processor_node(table, acpi_cpu_id);
>>         if (cpu_node) {
>> @@ -622,7 +622,7 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag)
>>  static int check_acpi_cpu_flag(unsigned int cpu, int rev, u32 flag)
>>  {
>>         struct acpi_table_header *table;
>> -       u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
>> +       u32 acpi_cpu_id = acpi_get_cpu_acpi_id(cpu);
>>         struct acpi_pptt_processor *cpu_node = NULL;
>>         int ret = -ENOENT;
>>
>> @@ -671,7 +671,7 @@ int acpi_get_cache_info(unsigned int cpu, unsigned int *levels,
>>
>>         pr_debug("Cache Setup: find cache levels for CPU=%d\n", cpu);
>>
>> -       acpi_cpu_id = get_acpi_id_for_cpu(cpu);
>> +       acpi_cpu_id = acpi_get_cpu_acpi_id(cpu);
>>         cpu_node = acpi_find_processor_node(table, acpi_cpu_id);
>>         if (!cpu_node)
>>                 return -ENOENT;
>> @@ -797,7 +797,7 @@ int find_acpi_cpu_topology_cluster(unsigned int cpu)
>>         if (!table)
>>                 return -ENOENT;
>>
>> -       acpi_cpu_id = get_acpi_id_for_cpu(cpu);
>> +       acpi_cpu_id = acpi_get_cpu_acpi_id(cpu);
>>         cpu_node = acpi_find_processor_node(table, acpi_cpu_id);
>>         if (!cpu_node || !cpu_node->parent)
>>                 return -ENOENT;
>> @@ -872,7 +872,7 @@ static void acpi_pptt_get_child_cpus(struct acpi_table_header *table_hdr,
>>         cpumask_clear(cpus);
>>
>>         for_each_possible_cpu(cpu) {
>> -               acpi_id = get_acpi_id_for_cpu(cpu);
>> +               acpi_id = acpi_get_cpu_acpi_id(cpu);
>>                 cpu_node = acpi_find_processor_node(table_hdr, acpi_id);
>>
>>                 while (cpu_node) {
>> @@ -966,7 +966,7 @@ int find_acpi_cache_level_from_id(u32 cache_id)
>>         for_each_possible_cpu(cpu) {
>>                 bool empty;
>>                 int level = 1;
>> -               u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
>> +               u32 acpi_cpu_id = acpi_get_cpu_acpi_id(cpu);
>>                 struct acpi_pptt_cache *cache;
>>                 struct acpi_pptt_processor *cpu_node;
>>
>> @@ -1030,7 +1030,7 @@ int acpi_pptt_get_cpumask_from_cache_id(u32 cache_id, cpumask_t *cpus)
>>         for_each_possible_cpu(cpu) {
>>                 bool empty;
>>                 int level = 1;
>> -               u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
>> +               u32 acpi_cpu_id = acpi_get_cpu_acpi_id(cpu);
>>                 struct acpi_pptt_cache *cache;
>>                 struct acpi_pptt_processor *cpu_node;
>>
>> diff --git a/drivers/acpi/riscv/rhct.c b/drivers/acpi/riscv/rhct.c
>> index caa2c16e1697..c15ce8c13136 100644
>> --- a/drivers/acpi/riscv/rhct.c
>> +++ b/drivers/acpi/riscv/rhct.c
>> @@ -44,7 +44,7 @@ int acpi_get_riscv_isa(struct acpi_table_header *table, unsigned int cpu, const
>>         struct acpi_rhct_isa_string *isa_node;
>>         struct acpi_table_rhct *rhct;
>>         u32 *hart_info_node_offset;
>> -       u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
>> +       u32 acpi_cpu_id = acpi_get_cpu_acpi_id(cpu);
>>
>>         BUG_ON(acpi_disabled);
>>
>> diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c
>> index 34430b68f602..506b661c60fd 100644
>> --- a/drivers/perf/arm_cspmu/arm_cspmu.c
>> +++ b/drivers/perf/arm_cspmu/arm_cspmu.c
>> @@ -1115,7 +1115,7 @@ static int arm_cspmu_acpi_get_cpus(struct arm_cspmu *cspmu)
>>         if (affinity_flag == ACPI_APMT_FLAGS_AFFINITY_PROC) {
>>                 for_each_possible_cpu(cpu) {
>>                         if (apmt_node->proc_affinity ==
>> -                           get_acpi_id_for_cpu(cpu)) {
>> +                           acpi_get_cpu_acpi_id(cpu)) {
>>                                 cpumask_set_cpu(cpu, &cspmu->associated_cpus);
>>                                 break;
>>                         }
>> --
>> 2.17.1
>>
> 


  reply	other threads:[~2026-03-10  3:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260303003625.39035-1-fengchengwen@huawei.com>
2026-03-05  8:36 ` [PATCH v2] PCI/TPH: Fix get cpu steer-tag fail on ARM64 platform 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
2026-03-09  4:18     ` fengchengwen
     [not found] ` <20260309041659.18815-1-fengchengwen@huawei.com>
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 [this message]
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

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=9d0d4685-fe6b-4ffd-b9bd-6a560c0d7c9f@huawei.com \
    --to=fengchengwen@huawei.com \
    --cc=Eric.VanTassell@amd.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=jeremy.linton@arm.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kernel@xen0n.name \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.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=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=rafael@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=sunilvl@oss.qualcomm.com \
    --cc=sunilvl@ventanamicro.com \
    --cc=wanghuiqiang@huawei.com \
    --cc=wangliupu@loongson.cn \
    --cc=wangzhou1@hisilicon.com \
    --cc=wei.huang2@amd.com \
    --cc=will@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

all inboxes | Powered by JetHome®