mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bibo Mao <maobibo@loongson.cn>
To: "Rafael J. Wysocki (Intel)" <rafael@kernel.org>
Cc: Huacai Chen <chenhuacai@kernel.org>, Len Brown <lenb@kernel.org>,
	Saket Dumbre <saket.dumbre@intel.com>,
	linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
	linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev,
	lixianglai@loongson.cn
Subject: Re: [PATCH v2 1/4] ACPI: LoongArch: Add acpi_arch_[late]_init()
Date: Thu, 23 Jul 2026 20:47:40 +0800	[thread overview]
Message-ID: <7b74d0c7-23ea-6c84-1dfd-e5e921badbdd@loongson.cn> (raw)
In-Reply-To: <CAJZ5v0j4w01XhqQ1EHKCMXOs=v-cddPu=NtdtX3wL7vAi6Y9Rg@mail.gmail.com>



On 2026/7/22 上午3:10, Rafael J. Wysocki (Intel) wrote:
> On Fri, Jul 17, 2026 at 8:44 AM Bibo Mao <maobibo@loongson.cn> wrote:
>>
>> LoongArch IOMMU scanning flow is similar with virtio-iommu,
>> there is early init and late_init. In early init function, PCI
>> ACS is enabled if there is IOMMU table, and late_init is called
>> after PCI device scanning, where IOVT table scanning function is
>> executed.
>>
>> Here add acpi_arch_init() and acpi_arch_late_init() API on LoongArch,
>> now they are both empty, In the future, IOVT table parsing will be
>> added.
>>
>> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
>> ---
>>   drivers/acpi/Makefile           |  2 +-
>>   drivers/acpi/bus.c              |  2 ++
>>   drivers/acpi/loongarch/Makefile |  2 ++
>>   drivers/acpi/loongarch/init.c   | 11 +++++++++++
>>   include/linux/acpi.h            |  1 +
>>   5 files changed, 17 insertions(+), 1 deletion(-)
>>   create mode 100644 drivers/acpi/loongarch/Makefile
>>   create mode 100644 drivers/acpi/loongarch/init.c
>>
>> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
>> index d1b0affb844f..91584a3c1e01 100644
>> --- a/drivers/acpi/Makefile
>> +++ b/drivers/acpi/Makefile
>> @@ -131,6 +131,6 @@ obj-y                               += dptf/
>>   obj-$(CONFIG_ARM64)            += arm64/
>>
>>   obj-$(CONFIG_ACPI_VIOT)                += viot.o
>> -
>> +obj-$(CONFIG_LOONGARCH)                += loongarch/
>>   obj-$(CONFIG_RISCV)            += riscv/
>>   obj-$(CONFIG_X86)              += x86/
>> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
>> index a30a904f6535..5f6924b9e29d 100644
>> --- a/drivers/acpi/bus.c
>> +++ b/drivers/acpi/bus.c
>> @@ -1571,6 +1571,7 @@ struct kobject *acpi_kobj;
>>   EXPORT_SYMBOL_GPL(acpi_kobj);
>>
>>   void __weak __init acpi_arch_init(void) { }
>> +void __weak __init acpi_arch_late_init(void) { }
>>
>>   static int __init acpi_init(void)
>>   {
>> @@ -1609,6 +1610,7 @@ static int __init acpi_init(void)
>>          acpi_wakeup_device_init();
>>          acpi_debugger_init();
>>          acpi_setup_sb_notify_handler();
>> +       acpi_arch_late_init();
>>          acpi_viot_init();
>>          return 0;
>>   }
>> diff --git a/drivers/acpi/loongarch/Makefile b/drivers/acpi/loongarch/Makefile
>> new file mode 100644
>> index 000000000000..d3764139dfaf
>> --- /dev/null
>> +++ b/drivers/acpi/loongarch/Makefile
>> @@ -0,0 +1,2 @@
>> +# SPDX-License-Identifier: GPL-2.0-only
>> +obj-y                                  += init.o
>> diff --git a/drivers/acpi/loongarch/init.c b/drivers/acpi/loongarch/init.c
>> new file mode 100644
>> index 000000000000..b11aa5c7d928
>> --- /dev/null
>> +++ b/drivers/acpi/loongarch/init.c
>> @@ -0,0 +1,11 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +
>> +#include <linux/acpi.h>
>> +
>> +void __init acpi_arch_init(void)
>> +{
>> +}
>> +
>> +void __init acpi_arch_late_init(void)
>> +{
>> +}
>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>> index 60ab50cb8930..c6a180341c2d 100644
>> --- a/include/linux/acpi.h
>> +++ b/include/linux/acpi.h
>> @@ -1617,6 +1617,7 @@ static inline int acpi_pptt_get_cpumask_from_cache_id(u32 cache_id,
>>   #endif
>>
>>   void acpi_arch_init(void);
>> +void acpi_arch_late_init(void);
>>
>>   #ifdef CONFIG_ACPI_PCC
>>   void acpi_init_pcc(void);
>> --
> 
> Please fold this one into the patch in which the new function is actually used.
Hi Rafael,

Thanks for reviewing my patch.

yeap, will fold this one into the patch where it is actually used.

Regards
Bibo Mao
> 
> Thanks!
> 


  reply	other threads:[~2026-07-23 12:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17  6:37 [PATCH v2 0/4] ACPI: LoongArch: Add IOVT table support Bibo Mao
2026-07-17  6:37 ` [PATCH v2 1/4] ACPI: LoongArch: Add acpi_arch_[late]_init() Bibo Mao
2026-07-21 19:10   ` Rafael J. Wysocki (Intel)
2026-07-23 12:47     ` Bibo Mao [this message]
2026-07-17  6:37 ` [PATCH v2 2/4] ACPI: LoongArch: Add IOVT device entry table scanning Bibo Mao
2026-07-21 19:09   ` Rafael J. Wysocki (Intel)
2026-07-23 12:44     ` Bibo Mao
2026-07-17  6:37 ` [PATCH v2 3/4] ACPI: scan: Add support for LoongArch in acpi_iommu_configure_id() Bibo Mao
2026-07-21 19:07   ` Rafael J. Wysocki (Intel)
2026-07-17  6:37 ` [PATCH v2 4/4] MAINTAINERS: Add entry for drivers/acpi/loongarch Bibo Mao

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=7b74d0c7-23ea-6c84-1dfd-e5e921badbdd@loongson.cn \
    --to=maobibo@loongson.cn \
    --cc=acpica-devel@lists.linux.dev \
    --cc=chenhuacai@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixianglai@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=rafael@kernel.org \
    --cc=saket.dumbre@intel.com \
    /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®