Some of the ACPI code is arch-dependent and make the code can't be
compiled on !x86 and !ia64, the first two patches just do some rework
on the idle_boot_override and _PDC related stuff to make the ACPI
code more arch-independent.
The third patch just introduce map_gic_id() for ACPI processor core
followed by the ACPI 5.0 spec.
These three patches are just ACPI related so I send them out as
a separate patch set.
I have compiled the kernel successful after appling this patch set
on x86, ia64 and powerpc(with cross compile tool).
Changes since last RFC version:
a) Remove the RFC tag;
b) Move idle_boot_override out of the arch directory suggested
by Alan;
c) Make these 3 patches as a separate patch set since there are
not not related to the ARM/ARM64 platform.
Hanjun Guo (3):
ACPI / idle: Move idle_boot_override out of the arch directory
ACPI / processor_core: Rework _PDC related stuff to make it more
arch-independent
ACPI: Introduce map_gic_id() to get apic id from MADT or _MAT method
arch/ia64/include/asm/acpi.h | 5 +---
arch/ia64/include/asm/processor.h | 3 ---
arch/ia64/kernel/acpi.c | 17 +++++++++++++
arch/powerpc/include/asm/processor.h | 1 -
arch/x86/include/asm/acpi.h | 19 +--------------
arch/x86/include/asm/processor.h | 3 ---
arch/x86/kernel/acpi/cstate.c | 31 ++++++++++++++++++++++++
arch/x86/kernel/process.c | 1 +
drivers/acpi/processor_core.c | 47 +++++++++++++++++++++---------------
include/linux/cpu.h | 8 ++++++
10 files changed, 87 insertions(+), 48 deletions(-)
--
1.8.2.2
Move idle_boot_override out of the arch directory to be a single enum
including both platforms values, this will make it rather easier to
avoid ifdefs around which definitions are for which processor in
generally used ACPI code.
IDLE_FORCE_MWAIT for IA64 is not used anywhere, so romove it.
No functional change in this patch.
Suggested-by: Alan <redacted>
Signed-off-by: Hanjun Guo <redacted>
---
arch/ia64/include/asm/processor.h | 3 ---
arch/powerpc/include/asm/processor.h | 1 -
arch/x86/include/asm/processor.h | 3 ---
arch/x86/kernel/process.c | 1 +
include/linux/cpu.h | 8 ++++++++
5 files changed, 9 insertions(+), 7 deletions(-)
@@ -440,7 +440,6 @@ static inline unsigned long get_clean_sp(unsigned long sp, int is_32)#endifexternunsignedlongcpuidle_disable;-enumidle_boot_override{IDLE_NO_OVERRIDE=0,IDLE_POWERSAVE_OFF};externintpowersave_nap;/* set if nap mode can be used in idle loop */externvoidpower7_nap(void);
_PDC related stuff in processor_core.c is little bit X86/IA64 dependent,
rework the code to make it more arch-independent, no functional change
in this patch.
The return value of acpi_processor_eval_pdc() should be 'acpi_status' but
defined as 'int', fix it too.
Signed-off-by: Hanjun Guo <redacted>
Signed-off-by: Graeme Gregory <redacted>
---
arch/ia64/include/asm/acpi.h | 5 +----
arch/ia64/kernel/acpi.c | 17 +++++++++++++++++
arch/x86/include/asm/acpi.h | 19 +------------------
arch/x86/kernel/acpi/cstate.c | 31 +++++++++++++++++++++++++++++++
drivers/acpi/processor_core.c | 21 ++-------------------
5 files changed, 52 insertions(+), 41 deletions(-)
Get apic id from MADT or _MAT method is not implemented on arm/arm64,
and ACPI 5.0 introduces GIC Structure for it, so this patch introduces
map_gic_id() to get apic id followed the ACPI 5.0 spec.
Signed-off-by: Hanjun Guo <redacted>
---
drivers/acpi/processor_core.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
Move idle_boot_override out of the arch directory to be a single enum
including both platforms values, this will make it rather easier to
avoid ifdefs around which definitions are for which processor in
generally used ACPI code.
IDLE_FORCE_MWAIT for IA64 is not used anywhere, so romove it.
No functional change in this patch.
Suggested-by: Alan <redacted>
Signed-off-by: Hanjun Guo <redacted>
---
arch/ia64/include/asm/processor.h | 3 ---
arch/powerpc/include/asm/processor.h | 1 -
arch/x86/include/asm/processor.h | 3 ---
arch/x86/kernel/process.c | 1 +
include/linux/cpu.h | 8 ++++++++
5 files changed, 9 insertions(+), 7 deletions(-)
@@ -440,7 +440,6 @@ static inline unsigned long get_clean_sp(unsigned long sp, int is_32)#endifexternunsignedlongcpuidle_disable;-enumidle_boot_override{IDLE_NO_OVERRIDE=0,IDLE_POWERSAVE_OFF};
I don't think it is used in the context of ACPI. Though it's same variable name,
it looks like it just used as boot to override the cpuidle option.
Does it still make any sense to combine this ?
quoted hunk
extern int powersave_nap; /* set if nap mode can be used in idle loop */
extern void power7_nap(void);
I do understand the idea behind this change, but IMO HALT and MWAIT are x86
specific and may not make sense for other architectures.
It will also require every architecture using ACPI to export
boot_option_idle_override which may not be really required.
Further the only users of boot_option_idle_override(outside x86) are:
1. drivers/acpi/processor_core.c
Your second patch is moving this to x86 specific code anyway
2. drivers/acpi/processor_idle.c
Currently idle driver is bit x86 specific and needs modifications to get it
working on ARM
Regards,
Sudeep
Move idle_boot_override out of the arch directory to be a single enum
including both platforms values, this will make it rather easier to
avoid ifdefs around which definitions are for which processor in
generally used ACPI code.
IDLE_FORCE_MWAIT for IA64 is not used anywhere, so romove it.
No functional change in this patch.
Suggested-by: Alan <redacted>
Signed-off-by: Hanjun Guo <redacted>
---
arch/ia64/include/asm/processor.h | 3 ---
arch/powerpc/include/asm/processor.h | 1 -
arch/x86/include/asm/processor.h | 3 ---
arch/x86/kernel/process.c | 1 +
include/linux/cpu.h | 8 ++++++++
5 files changed, 9 insertions(+), 7 deletions(-)
@@ -440,7 +440,6 @@ static inline unsigned long get_clean_sp(unsigned long sp, int is_32)#endifexternunsignedlongcpuidle_disable;-enumidle_boot_override{IDLE_NO_OVERRIDE=0,IDLE_POWERSAVE_OFF};
I don't think it is used in the context of ACPI. Though it's same variable name,
it looks like it just used as boot to override the cpuidle option.
Does it still make any sense to combine this ?
Yes, it is not related to ACPI on powerpc, I will investigate it will cause
compile warning or not if I don't combine this.
quoted
extern int powersave_nap; /* set if nap mode can be used in idle loop */
extern void power7_nap(void);
I do understand the idea behind this change, but IMO HALT and MWAIT are x86
specific and may not make sense for other architectures.
yes, this is the strange part, the value is arch-dependent.
It will also require every architecture using ACPI to export
boot_option_idle_override which may not be really required.
so, how about forget this patch and move boot_option_idle_override
related code into arch directory such as arch/x86/acpi/boot.c for
x86?
Further the only users of boot_option_idle_override(outside x86) are:
1. drivers/acpi/processor_core.c
Your second patch is moving this to x86 specific code anyway
2. drivers/acpi/processor_idle.c
Currently idle driver is bit x86 specific and needs modifications to get it
working on ARM
Yes, That's why I did not enable acpi idle driver on ARM64 for now.
Thanks
Hanjun
Move idle_boot_override out of the arch directory to be a single enum
including both platforms values, this will make it rather easier to
avoid ifdefs around which definitions are for which processor in
generally used ACPI code.
IDLE_FORCE_MWAIT for IA64 is not used anywhere, so romove it.
No functional change in this patch.
Suggested-by: Alan <redacted>
Signed-off-by: Hanjun Guo <redacted>
---
I do understand the idea behind this change, but IMO HALT and MWAIT are x86
specific and may not make sense for other architectures.
yes, this is the strange part, the value is arch-dependent.
quoted
It will also require every architecture using ACPI to export
boot_option_idle_override which may not be really required.
so, how about forget this patch and move boot_option_idle_override
related code into arch directory such as arch/x86/acpi/boot.c for
x86?
The general idea is that we can move all the arch-dependent codes
in ACPI driver to arch directory, then make codes in drivers/acpi/
arch independent.
Thanks
Hanjun
From: Rafael J. Wysocki <hidden> Date: 2014-01-18 13:33:45
On Saturday, January 18, 2014 11:52:18 AM Hanjun Guo wrote:
On 2014-1-18 11:45, Hanjun Guo wrote:
quoted
On 2014-1-17 20:06, Sudeep Holla wrote:
quoted
On 17/01/14 02:03, Hanjun Guo wrote:
quoted
Move idle_boot_override out of the arch directory to be a single enum
including both platforms values, this will make it rather easier to
avoid ifdefs around which definitions are for which processor in
generally used ACPI code.
IDLE_FORCE_MWAIT for IA64 is not used anywhere, so romove it.
No functional change in this patch.
Suggested-by: Alan <redacted>
Signed-off-by: Hanjun Guo <redacted>
---
I do understand the idea behind this change, but IMO HALT and MWAIT are x86
specific and may not make sense for other architectures.
yes, this is the strange part, the value is arch-dependent.
quoted
It will also require every architecture using ACPI to export
boot_option_idle_override which may not be really required.
so, how about forget this patch and move boot_option_idle_override
related code into arch directory such as arch/x86/acpi/boot.c for
x86?
The general idea is that we can move all the arch-dependent codes
in ACPI driver to arch directory, then make codes in drivers/acpi/
arch independent.
Well, MWAIT is arch-dependent, so I'm not sure how IDLE_NOMWAIT fits into
include/linux/cpu.h?
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
On Saturday, January 18, 2014 11:52:18 AM Hanjun Guo wrote:
quoted
On 2014-1-18 11:45, Hanjun Guo wrote:
quoted
On 2014-1-17 20:06, Sudeep Holla wrote:
quoted
On 17/01/14 02:03, Hanjun Guo wrote:
quoted
Move idle_boot_override out of the arch directory to be a single enum
including both platforms values, this will make it rather easier to
avoid ifdefs around which definitions are for which processor in
generally used ACPI code.
IDLE_FORCE_MWAIT for IA64 is not used anywhere, so romove it.
No functional change in this patch.
Suggested-by: Alan <redacted>
Signed-off-by: Hanjun Guo <redacted>
---
From: Rafael J. Wysocki <hidden> Date: 2014-01-20 23:20:19
On Monday, January 20, 2014 10:08:41 PM Hanjun Guo wrote:
On 2014?01?18? 21:47, Rafael J. Wysocki wrote:
quoted
On Saturday, January 18, 2014 11:52:18 AM Hanjun Guo wrote:
quoted
On 2014-1-18 11:45, Hanjun Guo wrote:
quoted
On 2014-1-17 20:06, Sudeep Holla wrote:
quoted
On 17/01/14 02:03, Hanjun Guo wrote:
quoted
Move idle_boot_override out of the arch directory to be a single enum
including both platforms values, this will make it rather easier to
avoid ifdefs around which definitions are for which processor in
generally used ACPI code.
IDLE_FORCE_MWAIT for IA64 is not used anywhere, so romove it.
No functional change in this patch.
Suggested-by: Alan <redacted>
Signed-off-by: Hanjun Guo <redacted>
---
I do understand the idea behind this change, but IMO HALT and MWAIT are x86
specific and may not make sense for other architectures.
yes, this is the strange part, the value is arch-dependent.
quoted
It will also require every architecture using ACPI to export
boot_option_idle_override which may not be really required.
so, how about forget this patch and move boot_option_idle_override
related code into arch directory such as arch/x86/acpi/boot.c for
x86?
The general idea is that we can move all the arch-dependent codes
in ACPI driver to arch directory, then make codes in drivers/acpi/
arch independent.
Well, MWAIT is arch-dependent, so I'm not sure how IDLE_NOMWAIT fits into
include/linux/cpu.h?
So you will not happy with this patch and should find another solution?
No, I'm not happy with it.
If you want to move that to an arch-agnostic header, the symbol names cannot
be arch-dependent any more.
Thanks!
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
On Monday, January 20, 2014 10:08:41 PM Hanjun Guo wrote:
quoted
On 2014?01?18? 21:47, Rafael J. Wysocki wrote:
quoted
On Saturday, January 18, 2014 11:52:18 AM Hanjun Guo wrote:
quoted
On 2014-1-18 11:45, Hanjun Guo wrote:
quoted
On 2014-1-17 20:06, Sudeep Holla wrote:
quoted
On 17/01/14 02:03, Hanjun Guo wrote:
quoted
Move idle_boot_override out of the arch directory to be a single enum
including both platforms values, this will make it rather easier to
avoid ifdefs around which definitions are for which processor in
generally used ACPI code.
IDLE_FORCE_MWAIT for IA64 is not used anywhere, so romove it.
No functional change in this patch.
Suggested-by: Alan <redacted>
Signed-off-by: Hanjun Guo <redacted>
---