Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpuidle: remove en_core_tk_irqen flag

The en_core_tk_irqen flag is set in all the cpuidle driver which
means it is not necessary to specify this flag.

Remove the flag and the code related to it.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Kevin Hilman <khilman@linaro.org> # for mach-omap2/*
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Daniel Lezcano and committed by
Rafael J. Wysocki
554c06ba 3dcb9f1b

+18 -86
-1
arch/arm/mach-at91/cpuidle.c
··· 47 47 static struct cpuidle_driver at91_idle_driver = { 48 48 .name = "at91_idle", 49 49 .owner = THIS_MODULE, 50 - .en_core_tk_irqen = 1, 51 50 .states[0] = ARM_CPUIDLE_WFI_STATE, 52 51 .states[1] = { 53 52 .enter = at91_enter_idle,
-1
arch/arm/mach-davinci/cpuidle.c
··· 62 62 static struct cpuidle_driver davinci_idle_driver = { 63 63 .name = "cpuidle-davinci", 64 64 .owner = THIS_MODULE, 65 - .en_core_tk_irqen = 1, 66 65 .states[0] = ARM_CPUIDLE_WFI_STATE, 67 66 .states[1] = { 68 67 .enter = davinci_enter_idle,
-1
arch/arm/mach-exynos/cpuidle.c
··· 58 58 static struct cpuidle_driver exynos4_idle_driver = { 59 59 .name = "exynos4_idle", 60 60 .owner = THIS_MODULE, 61 - .en_core_tk_irqen = 1, 62 61 }; 63 62 64 63 /* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */
-1
arch/arm/mach-imx/cpuidle-imx6q.c
··· 45 45 static struct cpuidle_driver imx6q_cpuidle_driver = { 46 46 .name = "imx6q_cpuidle", 47 47 .owner = THIS_MODULE, 48 - .en_core_tk_irqen = 1, 49 48 .states = { 50 49 /* WFI */ 51 50 ARM_CPUIDLE_WFI_STATE,
-1
arch/arm/mach-imx/pm-imx5.c
··· 164 164 static struct cpuidle_driver imx5_cpuidle_driver = { 165 165 .name = "imx5_cpuidle", 166 166 .owner = THIS_MODULE, 167 - .en_core_tk_irqen = 1, 168 167 .states[0] = { 169 168 .enter = imx5_cpuidle_enter, 170 169 .exit_latency = 2,
-1
arch/arm/mach-omap2/cpuidle34xx.c
··· 264 264 static struct cpuidle_driver omap3_idle_driver = { 265 265 .name = "omap3_idle", 266 266 .owner = THIS_MODULE, 267 - .en_core_tk_irqen = 1, 268 267 .states = { 269 268 { 270 269 .enter = omap3_enter_idle_bm,
-1
arch/arm/mach-omap2/cpuidle44xx.c
··· 164 164 static struct cpuidle_driver omap4_idle_driver = { 165 165 .name = "omap4_idle", 166 166 .owner = THIS_MODULE, 167 - .en_core_tk_irqen = 1, 168 167 .states = { 169 168 { 170 169 /* C1 - CPU0 ON + CPU1 ON + MPU ON */
-1
arch/arm/mach-s3c64xx/cpuidle.c
··· 45 45 static struct cpuidle_driver s3c64xx_cpuidle_driver = { 46 46 .name = "s3c64xx_cpuidle", 47 47 .owner = THIS_MODULE, 48 - .en_core_tk_irqen = 1, 49 48 .states = { 50 49 { 51 50 .enter = s3c64xx_enter_idle,
-1
arch/arm/mach-shmobile/cpuidle.c
··· 20 20 static struct cpuidle_driver shmobile_cpuidle_default_driver = { 21 21 .name = "shmobile_cpuidle", 22 22 .owner = THIS_MODULE, 23 - .en_core_tk_irqen = 1, 24 23 .states[0] = ARM_CPUIDLE_WFI_STATE, 25 24 .safe_state_index = 0, /* C1 */ 26 25 .state_count = 1,
-1
arch/arm/mach-shmobile/pm-sh7372.c
··· 410 410 static struct cpuidle_driver sh7372_cpuidle_driver = { 411 411 .name = "sh7372_cpuidle", 412 412 .owner = THIS_MODULE, 413 - .en_core_tk_irqen = 1, 414 413 .state_count = 5, 415 414 .safe_state_index = 0, /* C1 */ 416 415 .states[0] = ARM_CPUIDLE_WFI_STATE,
-1
arch/arm/mach-tegra/cpuidle-tegra114.c
··· 23 23 static struct cpuidle_driver tegra_idle_driver = { 24 24 .name = "tegra_idle", 25 25 .owner = THIS_MODULE, 26 - .en_core_tk_irqen = 1, 27 26 .state_count = 1, 28 27 .states = { 29 28 [0] = ARM_CPUIDLE_WFI_STATE_PWR(600),
-1
arch/arm/mach-tegra/cpuidle-tegra20.c
··· 51 51 static struct cpuidle_driver tegra_idle_driver = { 52 52 .name = "tegra_idle", 53 53 .owner = THIS_MODULE, 54 - .en_core_tk_irqen = 1, 55 54 .states = { 56 55 ARM_CPUIDLE_WFI_STATE_PWR(600), 57 56 #ifdef CONFIG_PM_SLEEP
-1
arch/arm/mach-tegra/cpuidle-tegra30.c
··· 43 43 static struct cpuidle_driver tegra_idle_driver = { 44 44 .name = "tegra_idle", 45 45 .owner = THIS_MODULE, 46 - .en_core_tk_irqen = 1, 47 46 #ifdef CONFIG_PM_SLEEP 48 47 .state_count = 2, 49 48 #else
-1
arch/arm/mach-ux500/cpuidle.c
··· 94 94 static struct cpuidle_driver ux500_idle_driver = { 95 95 .name = "ux500_idle", 96 96 .owner = THIS_MODULE, 97 - .en_core_tk_irqen = 1, 98 97 .states = { 99 98 ARM_CPUIDLE_WFI_STATE, 100 99 {
-1
arch/powerpc/platforms/pseries/processor_idle.c
··· 25 25 struct cpuidle_driver pseries_idle_driver = { 26 26 .name = "pseries_idle", 27 27 .owner = THIS_MODULE, 28 - .en_core_tk_irqen = 1, 29 28 }; 30 29 31 30 #define MAX_IDLE_STATE_COUNT 2
-1
arch/sh/kernel/cpu/shmobile/cpuidle.c
··· 55 55 static struct cpuidle_driver cpuidle_driver = { 56 56 .name = "sh_idle", 57 57 .owner = THIS_MODULE, 58 - .en_core_tk_irqen = 1, 59 58 .states = { 60 59 { 61 60 .exit_latency = 1,
-1
arch/x86/kernel/apm_32.c
··· 373 373 static struct cpuidle_driver apm_idle_driver = { 374 374 .name = "apm_idle", 375 375 .owner = THIS_MODULE, 376 - .en_core_tk_irqen = 1, 377 376 .states = { 378 377 { /* entry 0 is for polling */ }, 379 378 { /* entry 1 is for APM idle */
-1
drivers/acpi/processor_idle.c
··· 918 918 struct cpuidle_driver acpi_idle_driver = { 919 919 .name = "acpi_idle", 920 920 .owner = THIS_MODULE, 921 - .en_core_tk_irqen = 1, 922 921 }; 923 922 924 923 /**
-1
drivers/cpuidle/cpuidle-calxeda.c
··· 100 100 101 101 static struct cpuidle_driver calxeda_idle_driver = { 102 102 .name = "calxeda_idle", 103 - .en_core_tk_irqen = 1, 104 103 .states = { 105 104 ARM_CPUIDLE_WFI_STATE, 106 105 {
-1
drivers/cpuidle/cpuidle-kirkwood.c
··· 41 41 static struct cpuidle_driver kirkwood_idle_driver = { 42 42 .name = "kirkwood_idle", 43 43 .owner = THIS_MODULE, 44 - .en_core_tk_irqen = 1, 45 44 .states[0] = ARM_CPUIDLE_WFI_STATE, 46 45 .states[1] = { 47 46 .enter = kirkwood_enter_idle,
+18 -54
drivers/cpuidle/cpuidle.c
··· 43 43 44 44 static int __cpuidle_register_device(struct cpuidle_device *dev); 45 45 46 - static inline int cpuidle_enter(struct cpuidle_device *dev, 47 - struct cpuidle_driver *drv, int index) 48 - { 49 - struct cpuidle_state *target_state = &drv->states[index]; 50 - return target_state->enter(dev, drv, index); 51 - } 52 - 53 - static inline int cpuidle_enter_tk(struct cpuidle_device *dev, 54 - struct cpuidle_driver *drv, int index) 55 - { 56 - return cpuidle_wrap_enter(dev, drv, index, cpuidle_enter); 57 - } 58 - 59 - typedef int (*cpuidle_enter_t)(struct cpuidle_device *dev, 60 - struct cpuidle_driver *drv, int index); 61 - 62 - static cpuidle_enter_t cpuidle_enter_ops; 63 - 64 46 /** 65 47 * cpuidle_play_dead - cpu off-lining 66 48 * ··· 72 90 * @next_state: index into drv->states of the state to enter 73 91 */ 74 92 int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, 75 - int next_state) 93 + int index) 76 94 { 77 95 int entered_state; 78 96 79 - entered_state = cpuidle_enter_ops(dev, drv, next_state); 97 + struct cpuidle_state *target_state = &drv->states[index]; 98 + ktime_t time_start, time_end; 99 + s64 diff; 100 + 101 + time_start = ktime_get(); 102 + 103 + entered_state = target_state->enter(dev, drv, index); 104 + 105 + time_end = ktime_get(); 106 + 107 + local_irq_enable(); 108 + 109 + diff = ktime_to_us(ktime_sub(time_end, time_start)); 110 + if (diff > INT_MAX) 111 + diff = INT_MAX; 112 + 113 + dev->last_residency = (int) diff; 80 114 81 115 if (entered_state >= 0) { 82 116 /* Update cpuidle counters */ ··· 229 231 mutex_unlock(&cpuidle_lock); 230 232 } 231 233 232 - /** 233 - * cpuidle_wrap_enter - performs timekeeping and irqen around enter function 234 - * @dev: pointer to a valid cpuidle_device object 235 - * @drv: pointer to a valid cpuidle_driver object 236 - * @index: index of the target cpuidle state. 237 - */ 238 - int cpuidle_wrap_enter(struct cpuidle_device *dev, 239 - struct cpuidle_driver *drv, int index, 240 - int (*enter)(struct cpuidle_device *dev, 241 - struct cpuidle_driver *drv, int index)) 242 - { 243 - ktime_t time_start, time_end; 244 - s64 diff; 245 - 246 - time_start = ktime_get(); 247 - 248 - index = enter(dev, drv, index); 249 - 250 - time_end = ktime_get(); 251 - 252 - local_irq_enable(); 253 - 254 - diff = ktime_to_us(ktime_sub(time_end, time_start)); 255 - if (diff > INT_MAX) 256 - diff = INT_MAX; 257 - 258 - dev->last_residency = (int) diff; 259 - 260 - return index; 261 - } 262 - 263 234 #ifdef CONFIG_ARCH_HAS_CPU_RELAX 264 235 static int poll_idle(struct cpuidle_device *dev, 265 236 struct cpuidle_driver *drv, int index) ··· 299 332 if (ret) 300 333 return ret; 301 334 } 302 - 303 - cpuidle_enter_ops = drv->en_core_tk_irqen ? 304 - cpuidle_enter_tk : cpuidle_enter; 305 335 306 336 poll_idle_init(drv); 307 337
-1
drivers/idle/intel_idle.c
··· 71 71 static struct cpuidle_driver intel_idle_driver = { 72 72 .name = "intel_idle", 73 73 .owner = THIS_MODULE, 74 - .en_core_tk_irqen = 1, 75 74 }; 76 75 /* intel_idle.max_cstate=0 disables driver */ 77 76 static int max_cstate = CPUIDLE_STATE_MAX - 1;
-11
include/linux/cpuidle.h
··· 105 105 struct module *owner; 106 106 int refcnt; 107 107 108 - /* set to 1 to use the core cpuidle time keeping (for all states). */ 109 - unsigned int en_core_tk_irqen:1; 110 108 /* used by the cpuidle framework to setup the broadcast timer */ 111 109 unsigned int bctimer:1; 112 110 /* states array must be ordered in decreasing power consumption */ ··· 130 132 extern void cpuidle_resume(void); 131 133 extern int cpuidle_enable_device(struct cpuidle_device *dev); 132 134 extern void cpuidle_disable_device(struct cpuidle_device *dev); 133 - extern int cpuidle_wrap_enter(struct cpuidle_device *dev, 134 - struct cpuidle_driver *drv, int index, 135 - int (*enter)(struct cpuidle_device *dev, 136 - struct cpuidle_driver *drv, int index)); 137 135 extern int cpuidle_play_dead(void); 138 136 139 137 extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev); ··· 156 162 static inline int cpuidle_enable_device(struct cpuidle_device *dev) 157 163 {return -ENODEV; } 158 164 static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } 159 - static inline int cpuidle_wrap_enter(struct cpuidle_device *dev, 160 - struct cpuidle_driver *drv, int index, 161 - int (*enter)(struct cpuidle_device *dev, 162 - struct cpuidle_driver *drv, int index)) 163 - { return -ENODEV; } 164 165 static inline int cpuidle_play_dead(void) {return -ENODEV; } 165 166 #endif 166 167