Commit 554c06ba authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Rafael J. Wysocki

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: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Kevin Hilman <khilman@linaro.org>  # for mach-omap2/*
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 3dcb9f1b
...@@ -47,7 +47,6 @@ static int at91_enter_idle(struct cpuidle_device *dev, ...@@ -47,7 +47,6 @@ static int at91_enter_idle(struct cpuidle_device *dev,
static struct cpuidle_driver at91_idle_driver = { static struct cpuidle_driver at91_idle_driver = {
.name = "at91_idle", .name = "at91_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states[0] = ARM_CPUIDLE_WFI_STATE, .states[0] = ARM_CPUIDLE_WFI_STATE,
.states[1] = { .states[1] = {
.enter = at91_enter_idle, .enter = at91_enter_idle,
......
...@@ -62,7 +62,6 @@ static int davinci_enter_idle(struct cpuidle_device *dev, ...@@ -62,7 +62,6 @@ static int davinci_enter_idle(struct cpuidle_device *dev,
static struct cpuidle_driver davinci_idle_driver = { static struct cpuidle_driver davinci_idle_driver = {
.name = "cpuidle-davinci", .name = "cpuidle-davinci",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states[0] = ARM_CPUIDLE_WFI_STATE, .states[0] = ARM_CPUIDLE_WFI_STATE,
.states[1] = { .states[1] = {
.enter = davinci_enter_idle, .enter = davinci_enter_idle,
......
...@@ -58,7 +58,6 @@ static DEFINE_PER_CPU(struct cpuidle_device, exynos4_cpuidle_device); ...@@ -58,7 +58,6 @@ static DEFINE_PER_CPU(struct cpuidle_device, exynos4_cpuidle_device);
static struct cpuidle_driver exynos4_idle_driver = { static struct cpuidle_driver exynos4_idle_driver = {
.name = "exynos4_idle", .name = "exynos4_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
}; };
/* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */ /* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */
......
...@@ -45,7 +45,6 @@ static int imx6q_enter_wait(struct cpuidle_device *dev, ...@@ -45,7 +45,6 @@ static int imx6q_enter_wait(struct cpuidle_device *dev,
static struct cpuidle_driver imx6q_cpuidle_driver = { static struct cpuidle_driver imx6q_cpuidle_driver = {
.name = "imx6q_cpuidle", .name = "imx6q_cpuidle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states = { .states = {
/* WFI */ /* WFI */
ARM_CPUIDLE_WFI_STATE, ARM_CPUIDLE_WFI_STATE,
......
...@@ -164,7 +164,6 @@ static int imx5_cpuidle_enter(struct cpuidle_device *dev, ...@@ -164,7 +164,6 @@ static int imx5_cpuidle_enter(struct cpuidle_device *dev,
static struct cpuidle_driver imx5_cpuidle_driver = { static struct cpuidle_driver imx5_cpuidle_driver = {
.name = "imx5_cpuidle", .name = "imx5_cpuidle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states[0] = { .states[0] = {
.enter = imx5_cpuidle_enter, .enter = imx5_cpuidle_enter,
.exit_latency = 2, .exit_latency = 2,
......
...@@ -264,7 +264,6 @@ static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); ...@@ -264,7 +264,6 @@ static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev);
static struct cpuidle_driver omap3_idle_driver = { static struct cpuidle_driver omap3_idle_driver = {
.name = "omap3_idle", .name = "omap3_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states = { .states = {
{ {
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
......
...@@ -164,7 +164,6 @@ static DEFINE_PER_CPU(struct cpuidle_device, omap_idle_dev); ...@@ -164,7 +164,6 @@ static DEFINE_PER_CPU(struct cpuidle_device, omap_idle_dev);
static struct cpuidle_driver omap4_idle_driver = { static struct cpuidle_driver omap4_idle_driver = {
.name = "omap4_idle", .name = "omap4_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states = { .states = {
{ {
/* C1 - CPU0 ON + CPU1 ON + MPU ON */ /* C1 - CPU0 ON + CPU1 ON + MPU ON */
......
...@@ -45,7 +45,6 @@ static DEFINE_PER_CPU(struct cpuidle_device, s3c64xx_cpuidle_device); ...@@ -45,7 +45,6 @@ static DEFINE_PER_CPU(struct cpuidle_device, s3c64xx_cpuidle_device);
static struct cpuidle_driver s3c64xx_cpuidle_driver = { static struct cpuidle_driver s3c64xx_cpuidle_driver = {
.name = "s3c64xx_cpuidle", .name = "s3c64xx_cpuidle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states = { .states = {
{ {
.enter = s3c64xx_enter_idle, .enter = s3c64xx_enter_idle,
......
...@@ -20,7 +20,6 @@ static struct cpuidle_device shmobile_cpuidle_dev; ...@@ -20,7 +20,6 @@ static struct cpuidle_device shmobile_cpuidle_dev;
static struct cpuidle_driver shmobile_cpuidle_default_driver = { static struct cpuidle_driver shmobile_cpuidle_default_driver = {
.name = "shmobile_cpuidle", .name = "shmobile_cpuidle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states[0] = ARM_CPUIDLE_WFI_STATE, .states[0] = ARM_CPUIDLE_WFI_STATE,
.safe_state_index = 0, /* C1 */ .safe_state_index = 0, /* C1 */
.state_count = 1, .state_count = 1,
......
...@@ -410,7 +410,6 @@ static int sh7372_enter_a4s(struct cpuidle_device *dev, ...@@ -410,7 +410,6 @@ static int sh7372_enter_a4s(struct cpuidle_device *dev,
static struct cpuidle_driver sh7372_cpuidle_driver = { static struct cpuidle_driver sh7372_cpuidle_driver = {
.name = "sh7372_cpuidle", .name = "sh7372_cpuidle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.state_count = 5, .state_count = 5,
.safe_state_index = 0, /* C1 */ .safe_state_index = 0, /* C1 */
.states[0] = ARM_CPUIDLE_WFI_STATE, .states[0] = ARM_CPUIDLE_WFI_STATE,
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
static struct cpuidle_driver tegra_idle_driver = { static struct cpuidle_driver tegra_idle_driver = {
.name = "tegra_idle", .name = "tegra_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.state_count = 1, .state_count = 1,
.states = { .states = {
[0] = ARM_CPUIDLE_WFI_STATE_PWR(600), [0] = ARM_CPUIDLE_WFI_STATE_PWR(600),
......
...@@ -51,7 +51,6 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev, ...@@ -51,7 +51,6 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
static struct cpuidle_driver tegra_idle_driver = { static struct cpuidle_driver tegra_idle_driver = {
.name = "tegra_idle", .name = "tegra_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states = { .states = {
ARM_CPUIDLE_WFI_STATE_PWR(600), ARM_CPUIDLE_WFI_STATE_PWR(600),
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
......
...@@ -43,7 +43,6 @@ static int tegra30_idle_lp2(struct cpuidle_device *dev, ...@@ -43,7 +43,6 @@ static int tegra30_idle_lp2(struct cpuidle_device *dev,
static struct cpuidle_driver tegra_idle_driver = { static struct cpuidle_driver tegra_idle_driver = {
.name = "tegra_idle", .name = "tegra_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
.state_count = 2, .state_count = 2,
#else #else
......
...@@ -94,7 +94,6 @@ static inline int ux500_enter_idle(struct cpuidle_device *dev, ...@@ -94,7 +94,6 @@ static inline int ux500_enter_idle(struct cpuidle_device *dev,
static struct cpuidle_driver ux500_idle_driver = { static struct cpuidle_driver ux500_idle_driver = {
.name = "ux500_idle", .name = "ux500_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states = { .states = {
ARM_CPUIDLE_WFI_STATE, ARM_CPUIDLE_WFI_STATE,
{ {
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
struct cpuidle_driver pseries_idle_driver = { struct cpuidle_driver pseries_idle_driver = {
.name = "pseries_idle", .name = "pseries_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
}; };
#define MAX_IDLE_STATE_COUNT 2 #define MAX_IDLE_STATE_COUNT 2
......
...@@ -55,7 +55,6 @@ static struct cpuidle_device cpuidle_dev; ...@@ -55,7 +55,6 @@ static struct cpuidle_device cpuidle_dev;
static struct cpuidle_driver cpuidle_driver = { static struct cpuidle_driver cpuidle_driver = {
.name = "sh_idle", .name = "sh_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states = { .states = {
{ {
.exit_latency = 1, .exit_latency = 1,
......
...@@ -373,7 +373,6 @@ static int apm_cpu_idle(struct cpuidle_device *dev, ...@@ -373,7 +373,6 @@ static int apm_cpu_idle(struct cpuidle_device *dev,
static struct cpuidle_driver apm_idle_driver = { static struct cpuidle_driver apm_idle_driver = {
.name = "apm_idle", .name = "apm_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states = { .states = {
{ /* entry 0 is for polling */ }, { /* entry 0 is for polling */ },
{ /* entry 1 is for APM idle */ { /* entry 1 is for APM idle */
......
...@@ -918,7 +918,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, ...@@ -918,7 +918,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
struct cpuidle_driver acpi_idle_driver = { struct cpuidle_driver acpi_idle_driver = {
.name = "acpi_idle", .name = "acpi_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
}; };
/** /**
......
...@@ -100,7 +100,6 @@ static void calxeda_idle_cpuidle_devices_uninit(void) ...@@ -100,7 +100,6 @@ static void calxeda_idle_cpuidle_devices_uninit(void)
static struct cpuidle_driver calxeda_idle_driver = { static struct cpuidle_driver calxeda_idle_driver = {
.name = "calxeda_idle", .name = "calxeda_idle",
.en_core_tk_irqen = 1,
.states = { .states = {
ARM_CPUIDLE_WFI_STATE, ARM_CPUIDLE_WFI_STATE,
{ {
......
...@@ -41,7 +41,6 @@ static int kirkwood_enter_idle(struct cpuidle_device *dev, ...@@ -41,7 +41,6 @@ static int kirkwood_enter_idle(struct cpuidle_device *dev,
static struct cpuidle_driver kirkwood_idle_driver = { static struct cpuidle_driver kirkwood_idle_driver = {
.name = "kirkwood_idle", .name = "kirkwood_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.states[0] = ARM_CPUIDLE_WFI_STATE, .states[0] = ARM_CPUIDLE_WFI_STATE,
.states[1] = { .states[1] = {
.enter = kirkwood_enter_idle, .enter = kirkwood_enter_idle,
......
...@@ -43,24 +43,6 @@ void disable_cpuidle(void) ...@@ -43,24 +43,6 @@ void disable_cpuidle(void)
static int __cpuidle_register_device(struct cpuidle_device *dev); static int __cpuidle_register_device(struct cpuidle_device *dev);
static inline int cpuidle_enter(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index)
{
struct cpuidle_state *target_state = &drv->states[index];
return target_state->enter(dev, drv, index);
}
static inline int cpuidle_enter_tk(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index)
{
return cpuidle_wrap_enter(dev, drv, index, cpuidle_enter);
}
typedef int (*cpuidle_enter_t)(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index);
static cpuidle_enter_t cpuidle_enter_ops;
/** /**
* cpuidle_play_dead - cpu off-lining * cpuidle_play_dead - cpu off-lining
* *
...@@ -90,11 +72,27 @@ int cpuidle_play_dead(void) ...@@ -90,11 +72,27 @@ int cpuidle_play_dead(void)
* @next_state: index into drv->states of the state to enter * @next_state: index into drv->states of the state to enter
*/ */
int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
int next_state) int index)
{ {
int entered_state; int entered_state;
entered_state = cpuidle_enter_ops(dev, drv, next_state); struct cpuidle_state *target_state = &drv->states[index];
ktime_t time_start, time_end;
s64 diff;
time_start = ktime_get();
entered_state = target_state->enter(dev, drv, index);
time_end = ktime_get();
local_irq_enable();
diff = ktime_to_us(ktime_sub(time_end, time_start));
if (diff > INT_MAX)
diff = INT_MAX;
dev->last_residency = (int) diff;
if (entered_state >= 0) { if (entered_state >= 0) {
/* Update cpuidle counters */ /* Update cpuidle counters */
...@@ -231,37 +229,6 @@ void cpuidle_resume(void) ...@@ -231,37 +229,6 @@ void cpuidle_resume(void)
mutex_unlock(&cpuidle_lock); mutex_unlock(&cpuidle_lock);
} }
/**
* cpuidle_wrap_enter - performs timekeeping and irqen around enter function
* @dev: pointer to a valid cpuidle_device object
* @drv: pointer to a valid cpuidle_driver object
* @index: index of the target cpuidle state.
*/
int cpuidle_wrap_enter(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index,
int (*enter)(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index))
{
ktime_t time_start, time_end;
s64 diff;
time_start = ktime_get();
index = enter(dev, drv, index);
time_end = ktime_get();
local_irq_enable();
diff = ktime_to_us(ktime_sub(time_end, time_start));
if (diff > INT_MAX)
diff = INT_MAX;
dev->last_residency = (int) diff;
return index;
}
#ifdef CONFIG_ARCH_HAS_CPU_RELAX #ifdef CONFIG_ARCH_HAS_CPU_RELAX
static int poll_idle(struct cpuidle_device *dev, static int poll_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index) struct cpuidle_driver *drv, int index)
...@@ -333,9 +300,6 @@ int cpuidle_enable_device(struct cpuidle_device *dev) ...@@ -333,9 +300,6 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
return ret; return ret;
} }
cpuidle_enter_ops = drv->en_core_tk_irqen ?
cpuidle_enter_tk : cpuidle_enter;
poll_idle_init(drv); poll_idle_init(drv);
ret = cpuidle_add_device_sysfs(dev); ret = cpuidle_add_device_sysfs(dev);
......
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
static struct cpuidle_driver intel_idle_driver = { static struct cpuidle_driver intel_idle_driver = {
.name = "intel_idle", .name = "intel_idle",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.en_core_tk_irqen = 1,
}; };
/* intel_idle.max_cstate=0 disables driver */ /* intel_idle.max_cstate=0 disables driver */
static int max_cstate = CPUIDLE_STATE_MAX - 1; static int max_cstate = CPUIDLE_STATE_MAX - 1;
......
...@@ -105,8 +105,6 @@ struct cpuidle_driver { ...@@ -105,8 +105,6 @@ struct cpuidle_driver {
struct module *owner; struct module *owner;
int refcnt; int refcnt;
/* set to 1 to use the core cpuidle time keeping (for all states). */
unsigned int en_core_tk_irqen:1;
/* used by the cpuidle framework to setup the broadcast timer */ /* used by the cpuidle framework to setup the broadcast timer */
unsigned int bctimer:1; unsigned int bctimer:1;
/* states array must be ordered in decreasing power consumption */ /* states array must be ordered in decreasing power consumption */
...@@ -132,10 +130,6 @@ extern void cpuidle_pause(void); ...@@ -132,10 +130,6 @@ extern void cpuidle_pause(void);
extern void cpuidle_resume(void); extern void cpuidle_resume(void);
extern int cpuidle_enable_device(struct cpuidle_device *dev); extern int cpuidle_enable_device(struct cpuidle_device *dev);
extern void cpuidle_disable_device(struct cpuidle_device *dev); extern void cpuidle_disable_device(struct cpuidle_device *dev);
extern int cpuidle_wrap_enter(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index,
int (*enter)(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index));
extern int cpuidle_play_dead(void); extern int cpuidle_play_dead(void);
extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev); extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
...@@ -162,11 +156,6 @@ static inline void cpuidle_resume(void) { } ...@@ -162,11 +156,6 @@ static inline void cpuidle_resume(void) { }
static inline int cpuidle_enable_device(struct cpuidle_device *dev) static inline int cpuidle_enable_device(struct cpuidle_device *dev)
{return -ENODEV; } {return -ENODEV; }
static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
static inline int cpuidle_wrap_enter(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index,
int (*enter)(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index))
{ return -ENODEV; }
static inline int cpuidle_play_dead(void) {return -ENODEV; } static inline int cpuidle_play_dead(void) {return -ENODEV; }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment