Skip to content

Commit

Permalink
Revert "PM / s2idle: Rename ->enter_freeze to ->enter_s2idle"
Browse files Browse the repository at this point in the history
This reverts commit f99a2fc.
  • Loading branch information
Nicklas373 committed Oct 16, 2020
1 parent f562440 commit 46f009f
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 106 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-tegra/cpuidle-tegra114.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static int tegra114_idle_power_down(struct cpuidle_device *dev,
return index;
}

static void tegra114_idle_enter_s2idle(struct cpuidle_device *dev,
static void tegra114_idle_enter_freeze(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
int index)
{
Expand All @@ -77,7 +77,7 @@ static struct cpuidle_driver tegra_idle_driver = {
#ifdef CONFIG_PM_SLEEP
[1] = {
.enter = tegra114_idle_power_down,
.enter_s2idle = tegra114_idle_enter_s2idle,
.enter_freeze = tegra114_idle_enter_freeze,
.exit_latency = 500,
.target_residency = 1000,
.flags = CPUIDLE_FLAG_TIMER_STOP,
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ static int acpi_idle_enter(struct cpuidle_device *dev,
return index;
}

static void acpi_idle_enter_s2idle(struct cpuidle_device *dev,
static void acpi_idle_enter_freeze(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index)
{
struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
Expand Down Expand Up @@ -867,14 +867,14 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)
drv->safe_state_index = count;
}
/*
* Halt-induced C1 is not good for ->enter_s2idle, because it
* Halt-induced C1 is not good for ->enter_freeze, because it
* re-enables interrupts on exit. Moreover, C1 is generally not
* particularly interesting from the suspend-to-idle angle, so
* avoid C1 and the situations in which we may need to fall back
* to it altogether.
*/
if (cx->type != ACPI_STATE_C1 && !acpi_idle_fallback_to_c1(pr))
state->enter_s2idle = acpi_idle_enter_s2idle;
state->enter_freeze = acpi_idle_enter_freeze;

count++;
if (count == CPUIDLE_STATE_MAX)
Expand Down
16 changes: 8 additions & 8 deletions drivers/cpuidle/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static int find_deepest_state(struct cpuidle_driver *drv,
if (s->disabled || su->disable || s->exit_latency <= latency_req
|| s->exit_latency > max_latency
|| (s->flags & forbidden_flags)
|| (freeze && !s->enter_s2idle))
|| (freeze && !s->enter_freeze))
continue;

latency_req = s->exit_latency;
Expand Down Expand Up @@ -120,7 +120,7 @@ int cpuidle_find_deepest_state(struct cpuidle_driver *drv,
}

#ifdef CONFIG_SUSPEND
static void enter_s2idle_proper(struct cpuidle_driver *drv,
static void enter_freeze_proper(struct cpuidle_driver *drv,
struct cpuidle_device *dev, int index)
{
/*
Expand All @@ -135,7 +135,7 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
* suspended is generally unsafe.
*/
stop_critical_timings();
drv->states[index].enter_s2idle(dev, drv, index);
drv->states[index].enter_freeze(dev, drv, index);
WARN_ON(!irqs_disabled());
/*
* timekeeping_resume() that will be called by tick_unfreeze() for the
Expand All @@ -147,25 +147,25 @@ static void enter_s2idle_proper(struct cpuidle_driver *drv,
}

/**
* cpuidle_enter_s2idle - Enter an idle state suitable for suspend-to-idle.
* cpuidle_enter_freeze - Enter an idle state suitable for suspend-to-idle.
* @drv: cpuidle driver for the given CPU.
* @dev: cpuidle device for the given CPU.
*
* If there are states with the ->enter_s2idle callback, find the deepest of
* If there are states with the ->enter_freeze callback, find the deepest of
* them and enter it with frozen tick.
*/
int cpuidle_enter_s2idle(struct cpuidle_driver *drv, struct cpuidle_device *dev)
int cpuidle_enter_freeze(struct cpuidle_driver *drv, struct cpuidle_device *dev)
{
int index;

/*
* Find the deepest state with ->enter_s2idle present, which guarantees
* Find the deepest state with ->enter_freeze present, which guarantees
* that interrupts won't be enabled when it exits and allows the tick to
* be frozen safely.
*/
index = find_deepest_state(drv, dev, UINT_MAX, 0, true);
if (index > 0)
enter_s2idle_proper(drv, dev, index);
enter_freeze_proper(drv, dev, index);

return index;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/cpuidle/lpm-levels.c
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ static int cluster_cpuidle_register(struct lpm_cluster *cl)
st->target_residency = 0;
st->enter = lpm_cpuidle_enter;
if (i == lpm_cpu->nlevels - 1)
st->enter_s2idle = lpm_cpuidle_freeze;
st->enter_freeze = lpm_cpuidle_freeze;
}

lpm_cpu->drv->state_count = lpm_cpu->nlevels;
Expand Down
Loading

0 comments on commit 46f009f

Please sign in to comment.