linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] ACPI: introduce acpi_arch_init
@ 2024-08-08  9:00 Miao Wang via B4 Relay
  2024-08-08  9:43 ` Hanjun Guo
  0 siblings, 1 reply; 6+ messages in thread
From: Miao Wang via B4 Relay @ 2024-08-08  9:00 UTC (permalink / raw)
  To: Hanjun Guo, Rafael J. Wysocki, Len Brown, Sunil V L, Sudeep Holla
  Cc: linux-acpi, linux-arm-kernel, Miao Wang

From: Miao Wang <shankerwangmiao@gmail.com>

To avoid arch-specific code in general ACPI initialization flow,
we introduce a weak symbol acpi_arch_init. Currently, arm64 can
utillize this to insert its specific flow. In the future,
other architectures can also have chance to define their own
arch-specific acpi initialization process if necessary.

Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
---
Changes from v1
- Change acpi_arch_init from a static inline stub to a weak function
  according to Haijun Guo's advice
---
Changes from v2:
- Add __init attribute to the weak acpi_arch_init stub
- Link to v2: https://lore.kernel.org/r/20240807-intro-acpi-arch-init-v2-1-9231e23a7721@gmail.com
---
 drivers/acpi/arm64/init.c | 2 +-
 drivers/acpi/bus.c        | 4 +++-
 include/linux/acpi.h      | 6 +-----
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/arm64/init.c b/drivers/acpi/arm64/init.c
index d0c8aed90fd1..7a47d8095a7d 100644
--- a/drivers/acpi/arm64/init.c
+++ b/drivers/acpi/arm64/init.c
@@ -2,7 +2,7 @@
 #include <linux/acpi.h>
 #include "init.h"
 
-void __init acpi_arm_init(void)
+void __init acpi_arch_init(void)
 {
 	if (IS_ENABLED(CONFIG_ACPI_AGDI))
 		acpi_agdi_init();
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 284bc2e03580..3b319b163d82 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1431,6 +1431,8 @@ static int __init acpi_bus_init(void)
 struct kobject *acpi_kobj;
 EXPORT_SYMBOL_GPL(acpi_kobj);
 
+void __weak __init acpi_arch_init(void) { }
+
 static int __init acpi_init(void)
 {
 	int result;
@@ -1458,7 +1460,7 @@ static int __init acpi_init(void)
 	acpi_viot_early_init();
 	acpi_hest_init();
 	acpi_ghes_init();
-	acpi_arm_init();
+	acpi_arch_init();
 	acpi_scan_init();
 	acpi_ec_init();
 	acpi_debugfs_init();
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 0687a442fec7..52862c377747 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1523,11 +1523,7 @@ static inline int find_acpi_cpu_topology_hetero_id(unsigned int cpu)
 }
 #endif
 
-#ifdef CONFIG_ARM64
-void acpi_arm_init(void);
-#else
-static inline void acpi_arm_init(void) { }
-#endif
+void acpi_arch_init(void);
 
 #ifdef CONFIG_ACPI_PCC
 void acpi_init_pcc(void);

---
base-commit: d4560686726f7a357922f300fc81f5964be8df04
change-id: 20240807-intro-acpi-arch-init-fc99fe33e62d

Best regards,
-- 
Miao Wang <shankerwangmiao@gmail.com>




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

* Re: [PATCH v3] ACPI: introduce acpi_arch_init
  2024-08-08  9:00 [PATCH v3] ACPI: introduce acpi_arch_init Miao Wang via B4 Relay
@ 2024-08-08  9:43 ` Hanjun Guo
  2024-08-27 20:40   ` Miao Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Hanjun Guo @ 2024-08-08  9:43 UTC (permalink / raw)
  To: shankerwangmiao, Rafael J. Wysocki, Len Brown, Sunil V L,
	Sudeep Holla
  Cc: linux-acpi, linux-arm-kernel

On 2024/8/8 17:00, Miao Wang via B4 Relay wrote:
> From: Miao Wang <shankerwangmiao@gmail.com>
> 
> To avoid arch-specific code in general ACPI initialization flow,
> we introduce a weak symbol acpi_arch_init. Currently, arm64 can
> utillize this to insert its specific flow. In the future,
> other architectures can also have chance to define their own
> arch-specific acpi initialization process if necessary.
> 
> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> Changes from v1
> - Change acpi_arch_init from a static inline stub to a weak function
>    according to Haijun Guo's advice
> ---
> Changes from v2:
> - Add __init attribute to the weak acpi_arch_init stub
> - Link to v2: https://lore.kernel.org/r/20240807-intro-acpi-arch-init-v2-1-9231e23a7721@gmail.com

Thanks for the quick update,

Acked-by: Hanjun Guo <guohanjun@huawei.com>

Thanks
Hanjun


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

* Re: [PATCH v3] ACPI: introduce acpi_arch_init
  2024-08-08  9:43 ` Hanjun Guo
@ 2024-08-27 20:40   ` Miao Wang
  2024-08-29 16:00     ` Sudeep Holla
  0 siblings, 1 reply; 6+ messages in thread
From: Miao Wang @ 2024-08-27 20:40 UTC (permalink / raw)
  To: Hanjun Guo, Rafael J. Wysocki, Len Brown, Sunil V L, Sudeep Holla
  Cc: linux-acpi, linux-arm-kernel



> 2024年8月8日 17:43,Hanjun Guo <guohanjun@huawei.com> 写道:
> 
> On 2024/8/8 17:00, Miao Wang via B4 Relay wrote:
>> From: Miao Wang <shankerwangmiao@gmail.com>
>> To avoid arch-specific code in general ACPI initialization flow,
>> we introduce a weak symbol acpi_arch_init. Currently, arm64 can
>> utillize this to insert its specific flow. In the future,
>> other architectures can also have chance to define their own
>> arch-specific acpi initialization process if necessary.
>> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
>> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
>> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
>> ---
>> Changes from v1
>> - Change acpi_arch_init from a static inline stub to a weak function
>>   according to Haijun Guo's advice
>> ---
>> Changes from v2:
>> - Add __init attribute to the weak acpi_arch_init stub
>> - Link to v2: https://lore.kernel.org/r/20240807-intro-acpi-arch-init-v2-1-9231e23a7721@gmail.com
> 
> Thanks for the quick update,
> 
> Acked-by: Hanjun Guo <guohanjun@huawei.com>

Hi, all. I wonder whether this patch is good to be applied or
any improvement is needed.

Cheers,

Miao Wang

> 
> Thanks
> Hanjun




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

* Re: [PATCH v3] ACPI: introduce acpi_arch_init
  2024-08-27 20:40   ` Miao Wang
@ 2024-08-29 16:00     ` Sudeep Holla
  2024-08-29 16:42       ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Sudeep Holla @ 2024-08-29 16:00 UTC (permalink / raw)
  To: Miao Wang
  Cc: Hanjun Guo, Rafael J. Wysocki, Len Brown, Sunil V L, linux-acpi,
	linux-arm-kernel

On Wed, Aug 28, 2024 at 04:40:29AM +0800, Miao Wang wrote:
> 
> 
> > 2024年8月8日 17:43,Hanjun Guo <guohanjun@huawei.com> 写道:
> > 
> > On 2024/8/8 17:00, Miao Wang via B4 Relay wrote:
> >> From: Miao Wang <shankerwangmiao@gmail.com>
> >> To avoid arch-specific code in general ACPI initialization flow,
> >> we introduce a weak symbol acpi_arch_init. Currently, arm64 can
> >> utillize this to insert its specific flow. In the future,
> >> other architectures can also have chance to define their own
> >> arch-specific acpi initialization process if necessary.
> >> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
> >> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
> >> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> >> ---
> >> Changes from v1
> >> - Change acpi_arch_init from a static inline stub to a weak function
> >>   according to Haijun Guo's advice
> >> ---
> >> Changes from v2:
> >> - Add __init attribute to the weak acpi_arch_init stub
> >> - Link to v2: https://lore.kernel.org/r/20240807-intro-acpi-arch-init-v2-1-9231e23a7721@gmail.com
> > 
> > Thanks for the quick update,
> > 
> > Acked-by: Hanjun Guo <guohanjun@huawei.com>
> 
> Hi, all. I wonder whether this patch is good to be applied or
> any improvement is needed.
> 

LGTM. Rafael, do you want to take this via your tree or arm64(need your ack)
once you are happy with the change ?

-- 
Regards,
Sudeep


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

* Re: [PATCH v3] ACPI: introduce acpi_arch_init
  2024-08-29 16:00     ` Sudeep Holla
@ 2024-08-29 16:42       ` Rafael J. Wysocki
  2024-08-29 17:58         ` Sudeep Holla
  0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2024-08-29 16:42 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Miao Wang, Hanjun Guo, Rafael J. Wysocki, Len Brown, Sunil V L,
	linux-acpi, linux-arm-kernel

On Thu, Aug 29, 2024 at 6:00 PM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Wed, Aug 28, 2024 at 04:40:29AM +0800, Miao Wang wrote:
> >
> >
> > > 2024年8月8日 17:43,Hanjun Guo <guohanjun@huawei.com> 写道:
> > >
> > > On 2024/8/8 17:00, Miao Wang via B4 Relay wrote:
> > >> From: Miao Wang <shankerwangmiao@gmail.com>
> > >> To avoid arch-specific code in general ACPI initialization flow,
> > >> we introduce a weak symbol acpi_arch_init. Currently, arm64 can
> > >> utillize this to insert its specific flow. In the future,
> > >> other architectures can also have chance to define their own
> > >> arch-specific acpi initialization process if necessary.
> > >> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
> > >> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
> > >> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> > >> ---
> > >> Changes from v1
> > >> - Change acpi_arch_init from a static inline stub to a weak function
> > >>   according to Haijun Guo's advice
> > >> ---
> > >> Changes from v2:
> > >> - Add __init attribute to the weak acpi_arch_init stub
> > >> - Link to v2: https://lore.kernel.org/r/20240807-intro-acpi-arch-init-v2-1-9231e23a7721@gmail.com
> > >
> > > Thanks for the quick update,
> > >
> > > Acked-by: Hanjun Guo <guohanjun@huawei.com>
> >
> > Hi, all. I wonder whether this patch is good to be applied or
> > any improvement is needed.
> >
>
> LGTM. Rafael, do you want to take this via your tree or arm64(need your ack)
> once you are happy with the change ?

Actually, I'd prefer the RISCV ACPI changes to land first:

https://lore.kernel.org/linux-acpi/20240812005929.113499-1-sunilvl@ventanamicro.com/

and then it can be consolidated to use acpi_arch_init() in both places.

I'm going to move the RISCV material to linux-next on Monday, but I'd
prefer to defer the consolidation to the 6.13 cycle (after 6.12-rc1 is
out).

Thanks!


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

* Re: [PATCH v3] ACPI: introduce acpi_arch_init
  2024-08-29 16:42       ` Rafael J. Wysocki
@ 2024-08-29 17:58         ` Sudeep Holla
  0 siblings, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2024-08-29 17:58 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Miao Wang, Sudeep Holla, Hanjun Guo, Len Brown, Sunil V L,
	linux-acpi, linux-arm-kernel

On Thu, Aug 29, 2024 at 06:42:16PM +0200, Rafael J. Wysocki wrote:
> On Thu, Aug 29, 2024 at 6:00 PM Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > On Wed, Aug 28, 2024 at 04:40:29AM +0800, Miao Wang wrote:
> > >
> > >
> > > > 2024年8月8日 17:43,Hanjun Guo <guohanjun@huawei.com> 写道:
> > > >
> > > > On 2024/8/8 17:00, Miao Wang via B4 Relay wrote:
> > > >> From: Miao Wang <shankerwangmiao@gmail.com>
> > > >> To avoid arch-specific code in general ACPI initialization flow,
> > > >> we introduce a weak symbol acpi_arch_init. Currently, arm64 can
> > > >> utillize this to insert its specific flow. In the future,
> > > >> other architectures can also have chance to define their own
> > > >> arch-specific acpi initialization process if necessary.
> > > >> Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
> > > >> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
> > > >> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> > > >> ---
> > > >> Changes from v1
> > > >> - Change acpi_arch_init from a static inline stub to a weak function
> > > >>   according to Haijun Guo's advice
> > > >> ---
> > > >> Changes from v2:
> > > >> - Add __init attribute to the weak acpi_arch_init stub
> > > >> - Link to v2: https://lore.kernel.org/r/20240807-intro-acpi-arch-init-v2-1-9231e23a7721@gmail.com
> > > >
> > > > Thanks for the quick update,
> > > >
> > > > Acked-by: Hanjun Guo <guohanjun@huawei.com>
> > >
> > > Hi, all. I wonder whether this patch is good to be applied or
> > > any improvement is needed.
> > >
> >
> > LGTM. Rafael, do you want to take this via your tree or arm64(need your ack)
> > once you are happy with the change ?
> 
> Actually, I'd prefer the RISCV ACPI changes to land first:
> 
> https://lore.kernel.org/linux-acpi/20240812005929.113499-1-sunilvl@ventanamicro.com/
> 
> and then it can be consolidated to use acpi_arch_init() in both places.
> 
> I'm going to move the RISCV material to linux-next on Monday, but I'd
> prefer to defer the consolidation to the 6.13 cycle (after 6.12-rc1 is
> out).

Makes sense, thanks!

-- 
Regards,
Sudeep


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

end of thread, other threads:[~2024-08-29 18:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-08  9:00 [PATCH v3] ACPI: introduce acpi_arch_init Miao Wang via B4 Relay
2024-08-08  9:43 ` Hanjun Guo
2024-08-27 20:40   ` Miao Wang
2024-08-29 16:00     ` Sudeep Holla
2024-08-29 16:42       ` Rafael J. Wysocki
2024-08-29 17:58         ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).