ACPI / processor_idle: Add ACPI v6.0 LPI support
v8 cover ACPI / processor_idle: Add ACPI v6.0 LPI support
ACPI 6.0 introduced LPI(Low Power Idle) states that provides an alternate method to describe processor idle states. It extends the specification to allow the expression of idle states like C-states selectable by the OSPM when a processor goes idle, but may affect more than one processor, and may affect other system components.
LPI extensions leverages the processor container device(again introduced in ACPI 6.0) allowing to express which parts of the system are affected by a given LPI state. It defines the local power states for each node in a hierarchical processor topology. The OSPM can use _LPI object to select a local power state for each level of processor hierarchy in the system. They used to produce a composite power state request that is presented to the platform by the OSPM.
Since multiple processors affect the idle state for any non-leaf hierarchy node, coordination of idle state requests between the processors is required. ACPI supports two different coordination schemes: Platform coordinated and OS initiated.
This series aims at providing basic and initial support for platform coordinated LPI states.
v7[7]->v8:
- Replaced HAVE_GENERIC_CPUIDLE_ENTER with CPU_IDLE_ENTER_WRAPPED macro, which is more cleaner and definately less confusing :) (Thanks to Rafael for the suggestion)
v6[6]->v7:
- Removed cpuidle-arm.h and introduced HAVE_GENERIC_CPUIDLE_ENTER and move the common code to cpuidle_generic_enter{,_state}
- Factored out common code between psci_{dt,acpi}_cpu_init_idle
v5[5]->v6:
- Added support for autopromotable state by not flattening them
- Moved arm_enter_idle_state to cpuidle-arm.h as it can be reused in ARM64 backend for ACPI LPI
- Other review comments(mainly for ARM64 from Lorenzo)
- Dropped support for skipping PM notifier as it needs to be fixed in GICv3 code(will be done separately)
v4[4]->v5:
- Addressed all the comments from Rafael
- Added support for retention mode(Prashant)
- Handled acpi_processor_get_power_info return value correctly(Vikas)
- Dropped __init from arm_cpuidle_init
- Merged psci prepartory patch into arm64 lpi support
v3[3]->v4:
- Dropped the preparatory patches that are merged already
- Added ARM64 arch specific callback implementations
- Addressed most of the review comments from Rafael
v2[2]->v3:
- rebased against v4.4-rc3
- fixed couple of issues reported by Prashanth and review comments from Ashwin
v1[1]->v2[2]:
- Fixed support for ACPI0010 processor container
- moved sleep state code out of processor_idle
Code is also available @[8]
Regards,
Sudeep
[1] http://marc.info/?l=linux-acpi&m=143871041601132&w=2
[2] http://marc.info/?l=linux-acpi&m=144241209800788&w=2
[3] http://marc.info/?l=linux-acpi&m=144906557814813&w=2
[4] http://marc.info/?l=linux-acpi&m=146106902731359&w=2
[5] http://marc.info/?l=linux-acpi&m=146298107608349&w=2
[6] http://marc.info/?l=linux-acpi&m=146591573516602&w=2
[7] http://marc.info/?l=linux-acpi&m=146712226917361&w=2
[8] git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git for_review/arm64_lpi
Sudeep Holla (6):
ACPI / processor_idle: introduce ACPI_PROCESSOR_CSTATE ACPI / processor_idle: Add support for Low Power Idle(LPI) states
arm64: cpuidle: drop __init section marker to arm_cpuidle_init
cpuidle: introduce CPU_IDLE_ENTER_WRAPPED macro for ARM{32,64}
arm64: add support for ACPI Low Power Idle(LPI)
ACPI : enable ACPI_PROCESSOR_IDLE on ARM64
arch/arm64/kernel/cpuidle.c | 20 +- drivers/acpi/Kconfig | 6 +- drivers/acpi/bus.c | 14 +- drivers/acpi/processor_driver.c | 2 +- drivers/acpi/processor_idle.c | 544 ++++++++++++++++++++++++++++++++++------ drivers/cpuidle/cpuidle-arm.c | 26 +- drivers/firmware/psci.c | 122 +++++++-- include/acpi/processor.h | 26 +- include/linux/acpi.h | 4 + include/linux/cpuidle.h | 18 ++ 10 files changed, 652 insertions(+), 130 deletions(-)
--
2.7.4
PATCH v8 1/6 ACPI / processor_idle: introduce ACPI_PROCESSOR_CSTATE
ACPI 6.0 adds a new method to specify the CPU idle states(C-states) called Low Power Idle(LPI) states. Since new architectures like ARM64 use only LPIs, introduce ACPI_PROCESSOR_CSTATE to encapsulate all the code supporting the old style C-states(_CST).
This patch will help to extend the processor_idle module to support LPI.
--- drivers/acpi/Kconfig | 4 +++ drivers/acpi/processor_idle.c | 80 ++++++++++++++++++++++++++++--------------- include/acpi/processor.h | 2 +- 3 files changed, 58 insertions(+), 28 deletions(-)
drivers/acpi/Kconfig +4 -0
@@ -213,6 +213,10 @@ config ACPI_CPU_FREQ_PSS bool select THERMAL +config ACPI_PROCESSOR_CSTATE + def_bool y + depends on IA64 || X86 + config ACPI_PROCESSOR_IDLE bool select CPU_IDLE
drivers/acpi/processor_idle.c +53 -27
111 lines not on this page · raw message
include/acpi/processor.h +1 -1
@@ -242,7 +242,7 @@ extern int acpi_processor_get_performance_info(struct acpi_processor *pr); DECLARE_PER_CPU(struct acpi_processor *, processors);extern struct acpi_processor_errata errata; -#ifdef ARCH_HAS_POWER_INIT +#if defined(ARCH_HAS_POWER_INIT ) && defined(CONFIG_ACPI_PROCESSOR_CSTATE )void acpi_processor_power_init_bm_check (struct acpi_processor_flags *flags,unsigned int cpu); int acpi_processor_ffh_cstate_probe(unsigned int cpu,
Signature · 1 line
2.7.4
PATCH v8 2/6 ACPI / processor_idle: Add support for Low Power Idle(LPI) states
ACPI 6.0 introduced an optional object _LPI that provides an alternate method to describe Low Power Idle states. It defines the local power states for each node in a hierarchical processor topology. The OSPM can use _LPI object to select a local power state for each level of processor hierarchy in the system. They used to produce a composite power state request that is presented to the platform by the OSPM.
Since multiple processors affect the idle state for any non-leaf hierarchy node, coordination of idle state requests between the processors is required. ACPI supports two different coordination schemes: Platform coordinated and OS initiated.
This patch adds initial support for Platform coordination scheme of LPI.
--- drivers/acpi/bus.c | 14 +- drivers/acpi/processor_driver.c | 2 +- drivers/acpi/processor_idle.c | 468 +++++++++++++++++++++++++++++++++++----- include/acpi/processor.h | 24 ++- include/linux/acpi.h | 4 + 5 files changed, 452 insertions(+), 60 deletions(-)
drivers/acpi/bus.c +13 -1
@@ -302,6 +302,14 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context)EXPORT_SYMBOL (acpi_run_osc);bool osc_sb_apei_support_acked; + +/* +* ACPI 6.0 Section 8.4.4.2 Idle State Coordination +* OSPM supports platform coordinated low power idle(LPI) states +*/ +bool osc_pc_lpi_support_confirmed; +EXPORT_SYMBOL_GPL (osc_pc_lpi_support_confirmed); +static u8 sb_uuid_str[] ="0811B06E-4A27-44F9-8D60-3CBBC22E7B48" ;static void acpi_bus_osc_support (void ) {
@@ -322,6 +330,7 @@ static void acpi_bus_osc_support(void) capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PPC_OST_SUPPORT ; capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_HOTPLUG_OST_SUPPORT ; + capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PCLPI_SUPPORT ;if (!ghes_disable) capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_APEI_SUPPORT ;
@@ -329,9 +338,12 @@ static void acpi_bus_osc_support(void)return ;if (ACPI_SUCCESS (acpi_run_osc (handle, &context))) {u32 *capbuf_ret = context.ret.pointer; -if (context.ret.length >OSC_SUPPORT_DWORD ) +if (context.ret.length >OSC_SUPPORT_DWORD ) { osc_sb_apei_support_acked = capbuf_ret[OSC_SUPPORT_DWORD ] &OSC_SB_APEI_SUPPORT ; + osc_pc_lpi_support_confirmed = + capbuf_ret[OSC_SUPPORT_DWORD ] &OSC_SB_PCLPI_SUPPORT ; + }kfree (context.ret.pointer); }/* do we need to check other returned cap? Sounds no */
drivers/acpi/processor_driver.c +1 -1
@@ -90,7 +90,7 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) pr->performance_platform_limit);break ;case ACPI_PROCESSOR_NOTIFY_POWER : -acpi_processor_cst_has_changed (pr); +acpi_processor_power_state_has_changed (pr);acpi_bus_generate_netlink_event (device->pnp.device_class,dev_name (&device->dev), event,0 );break ;
drivers/acpi/processor_idle.c +413 -55
564 lines not on this page · raw message
include/acpi/processor.h +21 -3
@@ -39,6 +39,7 @@#define ACPI_CSTATE_SYSTEMIO 0#define ACPI_CSTATE_FFH 1#define ACPI_CSTATE_HALT 2 +#define ACPI_CSTATE_INTEGER 3#define ACPI_CX_DESC_LEN 32
@@ -67,9 +68,25 @@ struct acpi_processor_cx {char desc[ACPI_CX_DESC_LEN ]; }; +struct acpi_lpi_state { +u32 min_residency; +u32 wake_latency;/* worst case */ +u32 flags; +u32 arch_flags; +u32 res_cnt_freq; +u32 enable_parent_state; +u64 address; +u8 index; +u8 entry_method; +char desc[ACPI_CX_DESC_LEN ]; +}; +struct acpi_processor_power {int count; -struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER ]; +union { +struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER ]; +struct acpi_lpi_state lpi_states[ACPI_PROCESSOR_MAX_POWER ]; + };int timer_broadcast_on_state; };
@@ -189,6 +206,7 @@ struct acpi_processor_flags { u8 bm_control:1; u8 bm_check:1; u8 has_cst:1; + u8 has_lpi:1; u8 power_setup_done:1; u8 bm_rld_set:1; u8 need_hotplug_init:1;
@@ -371,7 +389,7 @@ extern struct cpuidle_driver acpi_idle_driver;#ifdef CONFIG_ACPI_PROCESSOR_IDLE int acpi_processor_power_init (struct acpi_processor *pr);int acpi_processor_power_exit (struct acpi_processor *pr); -int acpi_processor_cst_has_changed (struct acpi_processor *pr); +int acpi_processor_power_state_has_changed (struct acpi_processor *pr);int acpi_processor_hotplug (struct acpi_processor *pr);#else static inline int acpi_processor_power_init (struct acpi_processor *pr)
@@ -384,7 +402,7 @@ static inline int acpi_processor_power_exit(struct acpi_processor *pr)return -ENODEV ; } -static inline int acpi_processor_cst_has_changed (struct acpi_processor *pr) +static inline int acpi_processor_power_state_has_changed (struct acpi_processor *pr) {return -ENODEV ; }
include/linux/acpi.h +4 -0
@@ -444,8 +444,12 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);#define OSC_SB_HOTPLUG_OST_SUPPORT 0x00000008#define OSC_SB_APEI_SUPPORT 0x00000010#define OSC_SB_CPC_SUPPORT 0x00000020 +#define OSC_SB_CPCV2_SUPPORT 0x00000040 +#define OSC_SB_PCLPI_SUPPORT 0x00000080 +#define OSC_SB_OSLPI_SUPPORT 0x00000100extern bool osc_sb_apei_support_acked; +extern bool osc_pc_lpi_support_confirmed;/* PCI Host Bridge _OSC: Capabilities DWORD 2: Support Field */ #define OSC_PCI_EXT_CONFIG_SUPPORT 0x00000001
Signature · 1 line
2.7.4
PATCH v8 3/6 arm64: cpuidle: drop __init section marker to arm_cpuidle_init
Commit ea389daa7fd9 ("arm64: cpuidle: add __init section marker to arm_cpuidle_init") added the __init annotation to arm_cpuidle_init as it was not needed after booting which was correct at that time.
However with the introduction of ACPI LPI support, this will be used from cpuhotplug path in ACPI processor driver.
This patch drops the __init annotation from arm_cpuidle_init to avoid the following warning:
WARNING: vmlinux.o(.text+0x113c8): Section mismatch in reference from the
function acpi_processor_ffh_lpi_probe() to the function .init.text:arm_cpuidle_init()
The function acpi_processor_ffh_lpi_probe() references
the function __init arm_cpuidle_init().
This is often because acpi_processor_ffh_lpi_probe lacks a __init annotation or the annotation of arm_cpuidle_init is wrong.
--- arch/arm64/kernel/cpuidle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/cpuidle.c +1 -1
@@ -15,7 +15,7 @@#include <asm/cpuidle.h> #include <asm/cpu_ops.h> -int __init arm_cpuidle_init (unsigned int cpu) +int arm_cpuidle_init (unsigned int cpu) {int ret = -EOPNOTSUPP ;
Signature · 1 line
2.7.4
PATCH v8 4/6 cpuidle: introduce CPU_IDLE_ENTER_WRAPPED macro for ARM{32,64}
The function arm_enter_idle_state is exactly the same in both generic ARM{32,64} CPUIdle driver and will be the same even on ARM64 backend for ACPI processor idle driver. So we can unify it and move it to a common place by introducing CPU_IDLE_ENTER_WRAPPED macro that can be used in all places avoiding duplication.
This is in preparation of reuse of the generic cpuidle entry function for ACPI LPI support on ARM64.
--- drivers/cpuidle/cpuidle-arm.c | 26 ++++++-------------------- include/linux/cpuidle.h | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 20 deletions(-)
drivers/cpuidle/cpuidle-arm.c +6 -20
@@ -36,26 +36,12 @@static int arm_enter_idle_state (struct cpuidle_device *dev,struct cpuidle_driver *drv,int idx) { -int ret; - -if (!idx) { -cpu_do_idle (); -return idx; - } - - ret =cpu_pm_enter (); -if (!ret) { -/* -* Pass idle state index to cpu_suspend which in turn will -* call the CPU ops suspend protocol with idle index as a -* parameter. -*/ - ret =arm_cpuidle_suspend (idx); - -cpu_pm_exit (); - } - -return ret ?-1 : idx; +/* +* Pass idle state index to arm_cpuidle_suspend which in turn +* will call the CPU ops suspend protocol with idle index as a +* parameter. +*/ +return CPU_IDLE_ENTER_WRAPPED (arm_cpuidle_suspend, idx); }static struct cpuidle_driver arm_idle_driver = {
include/linux/cpuidle.h +18 -0
@@ -252,4 +252,22 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov)#define CPUIDLE_DRIVER_STATE_START 0#endif +#define CPU_IDLE_ENTER_WRAPPED (low_level_idle_enter, idx) \ +({ \ + int __ret; \ + \ + if (!idx) { \ + cpu_do_idle(); \ + return idx; \ + } \ + \ + __ret = cpu_pm_enter(); \ + if (!__ret) { \ + __ret = low_level_idle_enter(idx); \ + cpu_pm_exit(); \ + } \ + \ + __ret ? -1 : idx; \ +}) +#endif /* _LINUX_CPUIDLE_H */
Signature · 1 line
2.7.4
PATCH v8 5/6 arm64: add support for ACPI Low Power Idle(LPI)
This patch adds appropriate callbacks to support ACPI Low Power Idle (LPI) on ARM64.
--- arch/arm64/kernel/cpuidle.c | 18 +++++++ drivers/firmware/psci.c | 122 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 118 insertions(+), 22 deletions(-)
arch/arm64/kernel/cpuidle.c +18 -0
@@ -9,6 +9,9 @@* published by the Free Software Foundation. */ +#include <linux/acpi.h> +#include <linux/cpuidle.h> +#include <linux/cpu_pm.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -39,3 +42,18 @@ int arm_cpuidle_suspend(int index)return cpu_ops[cpu]->cpu_suspend (index); } + +#ifdef CONFIG_ACPI + +#include <acpi/processor.h> + +int acpi_processor_ffh_lpi_probe (unsigned int cpu) +{ +return arm_cpuidle_init (cpu); +} + +int acpi_processor_ffh_lpi_enter (struct acpi_lpi_state *lpi) +{ +return CPU_IDLE_ENTER_WRAPPED (arm_cpuidle_suspend, lpi->index); +} +#endif
drivers/firmware/psci.c +100 -22
164 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v8 6/6 ACPI : enable ACPI_PROCESSOR_IDLE on ARM64
Now that ACPI processor idle driver supports LPI(Low Power Idle), lets enable ACPI_PROCESSOR_IDLE for ARM64 too.
This patch just removes the IA64 and X86 dependency on ACPI_PROCESSOR_IDLE
--- drivers/acpi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/Kconfig +1 -1
@@ -238,7 +238,7 @@ config ACPI_CPPC_LIB config ACPI_PROCESSOR tristate "Processor" depends on X86 || IA64 || ARM64 - select ACPI_PROCESSOR_IDLE if X86 || IA64 + select ACPI_PROCESSOR_IDLE select ACPI_CPU_FREQ_PSS if X86 || IA64 default y help
Signature · 1 line
2.7.4
Re: [PATCH v8 5/6] arm64: add support for ACPI Low Power Idle(LPI)
In reply to Sudeep HollaQuoted 11 lines · Sudeep Holla
This patch adds appropriate callbacks to support ACPI Low Power Idle (LPI) on ARM64.
Cc Lorenzo Pieralisi <[email protected]>Cc Mark Rutland <[email protected]>Cc Daniel Lezcano <[email protected]>Cc "Rafael J. Wysocki" <[email protected]>Signed-off-by Sudeep Holla <[email protected]>--- arch/arm64/kernel/cpuidle.c | 18 +++++++ drivers/firmware/psci.c | 122 ++++++++++++++++++++++++++++++++++++--------
I would split this patch in two (ARM64 cpuidle and PSCI) and for the PSCI code (apologies, blame taken, it is entirely my fault) I think that the code in v6 was better, I asked you to factor out DT/ACPI idle states count and parameter retrieval but the end result is much more complicated than what it was in v6, so for PSCI ACPI idle states parsing I would revert to v6, apologies.
With changes above:
Quoted 211 lines
2 files changed, 118 insertions(+), 22 deletions(-)arch/arm64/kernel/cpuidle.c +18
-0@@ -9,6 +9,9 @@* published by the Free Software Foundation. */ +#include <linux/acpi.h> +#include <linux/cpuidle.h> +#include <linux/cpu_pm.h> #include <linux/of.h> #include <linux/of_device.h> @@ -39,3 +42,18 @@ int arm_cpuidle_suspend(int index)return cpu_ops[cpu]->cpu_suspend (index); } + +#ifdef CONFIG_ACPI + +#include <acpi/processor.h> + +int acpi_processor_ffh_lpi_probe (unsigned int cpu) +{ +return arm_cpuidle_init (cpu); +} + +int acpi_processor_ffh_lpi_enter (struct acpi_lpi_state *lpi) +{ +return CPU_IDLE_ENTER_WRAPPED (arm_cpuidle_suspend, lpi->index); +} +#endif drivers/firmware/psci.c +100
-22@@ -13,6 +13,7 @@#define pr_fmt (fmt) "psci: " fmt +#include <linux/acpi.h> #include <linux/arm-smccc.h> #include <linux/cpuidle.h> #include <linux/errno.h> @@ -250,12 +251,84 @@ static int __init psci_features(u32 psci_func_id)#ifdef CONFIG_CPU_IDLE static DEFINE_PER_CPU_READ_MOSTLY(u32 *, psci_power_state); -static int psci_dt_cpu_init_idle (struct device_node *cpu_node,int cpu) +static int psci_dt_get_state_count (struct device_node *cpu_dn) { -int i, ret, count =0 ; -u32 *psci_states; +int count =0 ;struct device_node *state_node; +/* Count idle states */ +while ((state_node =of_parse_phandle (cpu_dn,"cpu-idle-states" , + count))) { + count++; +of_node_put (state_node); + } + +return count; +} + +static int psci_dt_get_idle_state (struct device_node *node,int idx,u32 *state) +{ +int ret; +struct device_node *state_node; + + state_node =of_parse_phandle (node,"cpu-idle-states" , idx); + + ret =of_property_read_u32 (state_node,"arm,psci-suspend-param" , + state); +if (ret) +pr_warn (" * %s missing arm,psci-suspend-param property\n" , + state_node->full_name); + +of_node_put (state_node); + +return ret; +} + +#ifdef CONFIG_ACPI +#include <acpi/processor.h> + +static int psci_acpi_get_state_count (unsigned int cpu) +{ +struct acpi_processor *pr =per_cpu (processors, cpu); + +if (unlikely (!pr || !pr->flags.has_lpi)) +return -EINVAL ; + +return pr->power.count -1 ; +} + +static int psci_acpi_get_idle_state (unsigned int cpu,int idx,u32 *state) +{ +struct acpi_processor *pr =per_cpu (processors, cpu); +struct acpi_lpi_state *lpi = &pr->power.lpi_states[idx +1 ]; + +if (!lpi) +return -EINVAL ; + +/* +* Only bits[31:0] represent a PSCI power_state while +* bits[63:32] must be 0x0 as per ARM ACPI FFH Specification +*/ + *state = lpi->address; +return 0 ; +} +#else +static int psci_acpi_get_state_count (unsigned int cpu) +{ +return -EINVAL ; +} + +static int psci_acpi_get_idle_state (unsigned int cpu,int idx,u32 *state) +{ +return -EINVAL ; +} +#endif + +static int __psci_cpu_init_idle (struct device_node *cpu_dn,int cpu,bool acpi) +{ +int i, count, ret; +u32 *psci_states; +/* * If the PSCI cpu_suspend function hook has not been initialized * idle states must not be enabled, so bail out @@ -263,14 +336,12 @@ static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu)if (!psci_ops.cpu_suspend)return -EOPNOTSUPP ; -/* Count idle states */ -while ((state_node =of_parse_phandle (cpu_node,"cpu-idle-states" , - count))) { - count++; -of_node_put (state_node); - } +if (acpi) + count =psci_acpi_get_state_count (cpu); +else + count =psci_dt_get_state_count (cpu_dn); -if (!count) +if (count <=0 )return -ENODEV ; psci_states =kcalloc (count,sizeof (*psci_states),GFP_KERNEL );@@ -278,21 +349,15 @@ static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu)return -ENOMEM ;for (i =0 ; i < count; i++) { -u32 state; - - state_node =of_parse_phandle (cpu_node,"cpu-idle-states" , i); +u32 state =0 ; - ret =of_property_read_u32 (state_node, -"arm,psci-suspend-param" , - &state); -if (ret) { -pr_warn (" * %s missing arm,psci-suspend-param property\n" , - state_node->full_name); -of_node_put (state_node); +if (acpi) + ret =psci_acpi_get_idle_state (cpu, i, &state); +else + ret =psci_dt_get_idle_state (cpu_dn, i, &state); +if (ret) goto free_mem; - } -of_node_put (state_node);pr_debug ("psci-power-state %#x index %d\n" , state, i);if (!psci_power_state_is_valid (state)) {pr_warn ("Invalid PSCI power state %#x\n" , state);@@ -310,11 +375,24 @@ static int psci_dt_cpu_init_idle(struct device_node *cpu_node, int cpu)return ret; } +static int psci_dt_cpu_init_idle (struct device_node *cpu_node,int cpu) +{ +return __psci_cpu_init_idle (cpu_node, cpu, false); +} + +static int psci_acpi_cpu_init_idle (unsigned int cpu) +{ +return __psci_cpu_init_idle (NULL , cpu, true); +} +int psci_cpu_init_idle (unsigned int cpu) {struct device_node *cpu_node;int ret; +if (!acpi_disabled) +return psci_acpi_cpu_init_idle (cpu); + cpu_node =of_get_cpu_node (cpu,NULL );if (!cpu_node)return -ENODEV ;Signature · 1 line
2.7.4
Re: [PATCH v8 5/6] arm64: add support for ACPI Low Power Idle(LPI)
Quoted 13 lines · Lorenzo Pieralisi
Quoted 11 lines · Sudeep Holla
This patch adds appropriate callbacks to support ACPI Low Power Idle (LPI) on ARM64.
Cc Lorenzo Pieralisi <[email protected]>Cc Mark Rutland <[email protected]>Cc Daniel Lezcano <[email protected]>Cc "Rafael J. Wysocki" <[email protected]>Signed-off-by Sudeep Holla <[email protected]>--- arch/arm64/kernel/cpuidle.c | 18 +++++++ drivers/firmware/psci.c | 122 ++++++++++++++++++++++++++++++++++++--------
Quoted 1 line
I would split this patch in two (ARM64 cpuidle and PSCI)
Agreed, I combined it to get it functional in one go, but until we have 6/6, it won't work. So better to split that changes.
Quoted 7 lines
and for
the PSCI code (apologies, blame taken, it is entirely my fault) I think that the code in v6 was better, I asked you to factor out DT/ACPI idle states count and parameter retrieval but the end result is much more complicated than what it was in v6, so for PSCI ACPI idle states parsing I would revert to v6, apologies.
Yes I agree it got bit complicated. I will revert back to v6 for that part.
Quoted 4 lines
With changes above:
Thanks
Signature · 2 lines
Regards, Sudeep
Rafael J. Wysocki
maintainerQuoted 19 lines · Sudeep Holla
ACPI 6.0 introduced LPI(Low Power Idle) states that provides an alternate method to describe processor idle states. It extends the specification to allow the expression of idle states like C-states selectable by the OSPM when a processor goes idle, but may affect more than one processor, and may affect other system components.
LPI extensions leverages the processor container device(again introduced in ACPI 6.0) allowing to express which parts of the system are affected by a given LPI state. It defines the local power states for each node in a hierarchical processor topology. The OSPM can use
_LPIobject to select a local power state for each level of processor hierarchy in the system. They used to produce a composite power state request that is presented to the platform by the OSPM.Since multiple processors affect the idle state for any non-leaf hierarchy node, coordination of idle state requests between the processors is required. ACPI supports two different coordination schemes: Platform coordinated and OS initiated.
Quoted 7 lines
This series aims at providing basic and initial support for platform coordinated LPI states.
v7[7]->v8:
- ReplacedHAVE_GENERIC_CPUIDLE_ENTERwithCPU_IDLE_ENTER_WRAPPEDmacro, which is more cleaner and definately less confusing :) (Thanks to Rafael for the suggestion)
Patches [3-6/6] definitely look a lot cleaner to me now. :-)
That said, the name of the macro I suggested was just an example, so if people don't like this one, it'd be fine to change it as far as I'm concerned.
Thanks,
Rafael
Quoted 28 lines · Rafael J. Wysocki
Quoted 19 lines · Sudeep Holla
ACPI 6.0 introduced LPI(Low Power Idle) states that provides an alternate method to describe processor idle states. It extends the specification to allow the expression of idle states like C-states selectable by the OSPM when a processor goes idle, but may affect more than one processor, and may affect other system components.
LPI extensions leverages the processor container device(again introduced in ACPI 6.0) allowing to express which parts of the system are affected by a given LPI state. It defines the local power states for each node in a hierarchical processor topology. The OSPM can use
_LPIobject to select a local power state for each level of processor hierarchy in the system. They used to produce a composite power state request that is presented to the platform by the OSPM.Since multiple processors affect the idle state for any non-leaf hierarchy node, coordination of idle state requests between the processors is required. ACPI supports two different coordination schemes: Platform coordinated and OS initiated.
Quoted 7 lines
This series aims at providing basic and initial support for platform coordinated LPI states.
v7[7]->v8:
- ReplacedHAVE_GENERIC_CPUIDLE_ENTERwithCPU_IDLE_ENTER_WRAPPEDmacro, which is more cleaner and definately less confusing :) (Thanks to Rafael for the suggestion)
Quoted 6 lines
Patches [3-6/6] definitely look a lot cleaner to me now. :-)
That said, the name of the macro I suggested was just an example, so if people don't like this one, it'd be fine to change it as far as I'm concerned.
I can think of addition to indicate it's pm notifiers wrapper. i.e. CPU_IDLE_ENTER_PM_NOTIFIERS_WRAPPED. Is it too long ? I am happy with the way it is too.
Signature · 2 lines
Regards, Sudeep
Quoted 33 lines · Sudeep Holla
Quoted 30 lines · Rafael J. Wysocki
Quoted 19 lines · Sudeep Holla
ACPI 6.0 introduced LPI(Low Power Idle) states that provides an alternate method to describe processor idle states. It extends the specification to allow the expression of idle states like C-states selectable by the OSPM when a processor goes idle, but may affect more than one processor, and may affect other system components.
LPI extensions leverages the processor container device(again introduced in ACPI 6.0) allowing to express which parts of the system are affected by a given LPI state. It defines the local power states for each node in a hierarchical processor topology. The OSPM can use
_LPIobject to select a local power state for each level of processor hierarchy in the system. They used to produce a composite power state request that is presented to the platform by the OSPM.Since multiple processors affect the idle state for any non-leaf hierarchy node, coordination of idle state requests between the processors is required. ACPI supports two different coordination schemes: Platform coordinated and OS initiated.
Quoted 7 lines
This series aims at providing basic and initial support for platform coordinated LPI states.
v7[7]->v8:
- ReplacedHAVE_GENERIC_CPUIDLE_ENTERwithCPU_IDLE_ENTER_WRAPPEDmacro, which is more cleaner and definately less confusing :) (Thanks to Rafael for the suggestion)Patches [3-6/6] definitely look a lot cleaner to me now. :-)
Quoted 8 lines
Quoted 4 lines
That said, the name of the macro I suggested was just an example, so if people don't like this one, it'd be fine to change it as far as I'm concerned.
I can think of addition to indicate it's pm notifiers wrapper. i.e.
CPU_IDLE_ENTER_PM_NOTIFIERS_WRAPPED. Is it too long ? I am happy with the way it is too.
CPU_PM_CPU_IDLE_ENTER() ? Anyway, that's really not a problem IMO, it makes sense to at least mention CPU PM in it given that's what the CPUIDLE enter function is wrapped within.
Lorenzo
Quoted 39 lines · Lorenzo Pieralisi
Quoted 38 lines · Sudeep Holla
Quoted 34 lines · Rafael J. Wysocki
Quoted 19 lines · Sudeep Holla
ACPI 6.0 introduced LPI(Low Power Idle) states that provides an alternate method to describe processor idle states. It extends the specification to allow the expression of idle states like C-states selectable by the OSPM when a processor goes idle, but may affect more than one processor, and may affect other system components.
LPI extensions leverages the processor container device(again introduced in ACPI 6.0) allowing to express which parts of the system are affected by a given LPI state. It defines the local power states for each node in a hierarchical processor topology. The OSPM can use
_LPIobject to select a local power state for each level of processor hierarchy in the system. They used to produce a composite power state request that is presented to the platform by the OSPM.Since multiple processors affect the idle state for any non-leaf hierarchy node, coordination of idle state requests between the processors is required. ACPI supports two different coordination schemes: Platform coordinated and OS initiated.
Quoted 7 lines
This series aims at providing basic and initial support for platform coordinated LPI states.
v7[7]->v8:
- ReplacedHAVE_GENERIC_CPUIDLE_ENTERwithCPU_IDLE_ENTER_WRAPPEDmacro, which is more cleaner and definately less confusing :) (Thanks to Rafael for the suggestion)Patches [3-6/6] definitely look a lot cleaner to me now. :-)
That said, the name of the macro I suggested was just an example, so if people don't like this one, it'd be fine to change it as far as I'm concerned.
Quoted 8 lines
Quoted 3 lines
I can think of addition to indicate it's pm notifiers wrapper. i.e.
CPU_IDLE_ENTER_PM_NOTIFIERS_WRAPPED. Is it too long ? I am happy with the way it is too.
CPU_PM_CPU_IDLE_ENTER()? Anyway, that's really not a problem IMO, it makes sense to at least mention CPU PM in it given that's what the CPUIDLE enter function is wrapped within.
Looks even better IMO, Rafael if you have no objection, I will change to CPU_PM_CPU_IDLE_ENTER ?
Signature · 2 lines
Regards, Sudeep