mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Acked-by: Kevin Hilman <[email protected]> # for mach-omap2/* Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
3dcb9f1b17
commit
554c06ba3e
23 changed files with 18 additions and 86 deletions
|
|
@ -100,7 +100,6 @@ static void calxeda_idle_cpuidle_devices_uninit(void)
|
|||
|
||||
static struct cpuidle_driver calxeda_idle_driver = {
|
||||
.name = "calxeda_idle",
|
||||
.en_core_tk_irqen = 1,
|
||||
.states = {
|
||||
ARM_CPUIDLE_WFI_STATE,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ static int kirkwood_enter_idle(struct cpuidle_device *dev,
|
|||
static struct cpuidle_driver kirkwood_idle_driver = {
|
||||
.name = "kirkwood_idle",
|
||||
.owner = THIS_MODULE,
|
||||
.en_core_tk_irqen = 1,
|
||||
.states[0] = ARM_CPUIDLE_WFI_STATE,
|
||||
.states[1] = {
|
||||
.enter = kirkwood_enter_idle,
|
||||
|
|
|
|||
|
|
@ -43,24 +43,6 @@ void disable_cpuidle(void)
|
|||
|
||||
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
|
||||
*
|
||||
|
|
@ -90,11 +72,27 @@ int cpuidle_play_dead(void)
|
|||
* @next_state: index into drv->states of the state to enter
|
||||
*/
|
||||
int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
|
||||
int next_state)
|
||||
int index)
|
||||
{
|
||||
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) {
|
||||
/* Update cpuidle counters */
|
||||
|
|
@ -231,37 +229,6 @@ void cpuidle_resume(void)
|
|||
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
|
||||
static int poll_idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv, int index)
|
||||
|
|
@ -333,9 +300,6 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
cpuidle_enter_ops = drv->en_core_tk_irqen ?
|
||||
cpuidle_enter_tk : cpuidle_enter;
|
||||
|
||||
poll_idle_init(drv);
|
||||
|
||||
ret = cpuidle_add_device_sysfs(dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue