Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (c) 2013 ARM/Linaro
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Authors: Daniel Lezcano <daniel.lezcano@linaro.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *          Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *          Nicolas Pitre <nicolas.pitre@linaro.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * Maintainer: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * Maintainer: Daniel Lezcano <daniel.lezcano@linaro.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/cpuidle.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/cpu_pm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/of.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <asm/cpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <asm/cputype.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <asm/cpuidle.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <asm/mcpm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <asm/smp_plat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <asm/suspend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include "dt_idle_states.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) static int bl_enter_powerdown(struct cpuidle_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 			      struct cpuidle_driver *drv, int idx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  * NB: Owing to current menu governor behaviour big and LITTLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  * index 1 states have to define exit_latency and target_residency for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  * cluster state since, when all CPUs in a cluster hit it, the cluster
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * can be shutdown. This means that when a single CPU enters this state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * the exit_latency and target_residency values are somewhat overkill.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  * There is no notion of cluster states in the menu governor, so CPUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  * have to define CPU states where possibly the cluster will be shutdown
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  * depending on the state of other CPUs. idle states entry and exit happen
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  * at random times; however the cluster state provides target_residency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)  * values as if all CPUs in a cluster enter the state at once; this is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  * somewhat optimistic and behaviour should be fixed either in the governor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  * or in the MCPM back-ends.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  * To make this driver 100% generic the number of states and the exit_latency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * target_residency values must be obtained from device tree bindings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  * exit_latency: refers to the TC2 vexpress test chip and depends on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  * current cluster operating point. It is the time it takes to get the CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  * up and running when the CPU is powered up on cluster wake-up from shutdown.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  * Current values for big and LITTLE clusters are provided for clusters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  * running at default operating points.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51)  * target_residency: it is the minimum amount of time the cluster has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)  * to be down to break even in terms of power consumption. cluster
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  * shutdown has inherent dynamic power costs (L2 writebacks to DRAM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  * being the main factor) that depend on the current operating points.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)  * The current values for both clusters are provided for a CPU whose half
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)  * of L2 lines are dirty and require cleaning to DRAM, and takes into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)  * account leakage static power values related to the vexpress TC2 testchip.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) static struct cpuidle_driver bl_idle_little_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	.name = "little_idle",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	.owner = THIS_MODULE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	.states[0] = ARM_CPUIDLE_WFI_STATE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	.states[1] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		.enter			= bl_enter_powerdown,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		.exit_latency		= 700,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		.target_residency	= 2500,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		.flags			= CPUIDLE_FLAG_TIMER_STOP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 		.name			= "C1",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		.desc			= "ARM little-cluster power down",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	.state_count = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) static const struct of_device_id bl_idle_state_match[] __initconst = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	{ .compatible = "arm,idle-state",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	  .data = bl_enter_powerdown },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) static struct cpuidle_driver bl_idle_big_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	.name = "big_idle",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	.owner = THIS_MODULE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	.states[0] = ARM_CPUIDLE_WFI_STATE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	.states[1] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		.enter			= bl_enter_powerdown,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		.exit_latency		= 500,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		.target_residency	= 2000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 		.flags			= CPUIDLE_FLAG_TIMER_STOP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 		.name			= "C1",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		.desc			= "ARM big-cluster power down",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	.state_count = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  * notrace prevents trace shims from getting inserted where they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  * should not. Global jumps and ldrex/strex must not be inserted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  * in power down sequences where caches and MMU may be turned off.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) static int notrace bl_powerdown_finisher(unsigned long arg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	/* MCPM works with HW CPU identifiers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	unsigned int mpidr = read_cpuid_mpidr();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	unsigned int cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	unsigned int cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	mcpm_set_entry_vector(cpu, cluster, cpu_resume);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	mcpm_cpu_suspend();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	/* return value != 0 means failure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)  * bl_enter_powerdown - Programs CPU to enter the specified state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)  * @dev: cpuidle device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)  * @drv: The target state to be programmed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  * @idx: state index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)  * Called from the CPUidle framework to program the device to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)  * specified target state selected by the governor.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) static int bl_enter_powerdown(struct cpuidle_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 				struct cpuidle_driver *drv, int idx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	cpu_pm_enter();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	cpu_suspend(0, bl_powerdown_finisher);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	/* signals the MCPM core that CPU is out of low power state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	mcpm_cpu_powered_up();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	cpu_pm_exit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	return idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int part_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	struct cpumask *cpumask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	int cpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	cpumask = kzalloc(cpumask_size(), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	if (!cpumask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	for_each_possible_cpu(cpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		if (smp_cpuid_part(cpu) == part_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 			cpumask_set_cpu(cpu, cpumask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	drv->cpumask = cpumask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) static const struct of_device_id compatible_machine_match[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	{ .compatible = "arm,vexpress,v2p-ca15_a7" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	{ .compatible = "samsung,exynos5420" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	{ .compatible = "samsung,exynos5800" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	{},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) static int __init bl_idle_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	struct device_node *root = of_find_node_by_path("/");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	const struct of_device_id *match_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	if (!root)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 		return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	 * Initialize the driver just for a compliant set of machines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	match_id = of_match_node(compatible_machine_match, root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	of_node_put(root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	if (!match_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	if (!mcpm_is_available())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		return -EUNATCH;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	 * For now the differentiation between little and big cores
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	 * is based on the part number. A7 cores are considered little
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	 * cores, A15 are considered big cores. This distinction may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	 * evolve in the future with a more generic matching approach.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	ret = bl_idle_driver_init(&bl_idle_little_driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 				  ARM_CPU_PART_CORTEX_A7);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	ret = bl_idle_driver_init(&bl_idle_big_driver, ARM_CPU_PART_CORTEX_A15);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		goto out_uninit_little;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	/* Start at index 1, index 0 standard WFI */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	ret = dt_init_idle_driver(&bl_idle_big_driver, bl_idle_state_match, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		goto out_uninit_big;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	/* Start at index 1, index 0 standard WFI */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	ret = dt_init_idle_driver(&bl_idle_little_driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 				  bl_idle_state_match, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		goto out_uninit_big;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	ret = cpuidle_register(&bl_idle_little_driver, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 		goto out_uninit_big;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	ret = cpuidle_register(&bl_idle_big_driver, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		goto out_unregister_little;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) out_unregister_little:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	cpuidle_unregister(&bl_idle_little_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) out_uninit_big:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	kfree(bl_idle_big_driver.cpumask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) out_uninit_little:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	kfree(bl_idle_little_driver.cpumask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) device_initcall(bl_idle_init);