Skip to content

Commit 1ec0e11

Browse files
tomeuvthierryreding
authored andcommitted
ARM: tegra: cpuidle: implement cpuidle_state.enter_freeze()
This callback is expected to do the same as enter() but it has to guarantee that interrupts aren't enabled at any point in its execution, as the tick is frozen. It will be called when the system goes to suspend-to-idle and will reduce power usage because CPUs won't be awaken for unnecessary IRQs. By setting the CPUIDLE_FLAG_TIMER_STOP flag, we can reuse the same code for both the enter() and enter_freeze() callbacks. Signed-off-by: Tomeu Vizoso <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent fc0cf17 commit 1ec0e11

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

arch/arm/mach-tegra/cpuidle-tegra114.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,26 @@ static int tegra114_idle_power_down(struct cpuidle_device *dev,
4545
tegra_set_cpu_in_lp2();
4646
cpu_pm_enter();
4747

48-
tick_broadcast_enter();
49-
5048
call_firmware_op(prepare_idle);
5149

5250
/* Do suspend by ourselves if the firmware does not implement it */
5351
if (call_firmware_op(do_idle, 0) == -ENOSYS)
5452
cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
5553

56-
tick_broadcast_exit();
57-
5854
cpu_pm_exit();
5955
tegra_clear_cpu_in_lp2();
6056

6157
local_fiq_enable();
6258

6359
return index;
6460
}
61+
62+
static void tegra114_idle_enter_freeze(struct cpuidle_device *dev,
63+
struct cpuidle_driver *drv,
64+
int index)
65+
{
66+
tegra114_idle_power_down(dev, drv, index);
67+
}
6568
#endif
6669

6770
static struct cpuidle_driver tegra_idle_driver = {
@@ -73,8 +76,10 @@ static struct cpuidle_driver tegra_idle_driver = {
7376
#ifdef CONFIG_PM_SLEEP
7477
[1] = {
7578
.enter = tegra114_idle_power_down,
79+
.enter_freeze = tegra114_idle_enter_freeze,
7680
.exit_latency = 500,
7781
.target_residency = 1000,
82+
.flags = CPUIDLE_FLAG_TIMER_STOP,
7883
.power_usage = 0,
7984
.name = "powered-down",
8085
.desc = "CPU power gated",

0 commit comments

Comments
 (0)