spin_unlock(&debug_lock);
}
-static void setup_broadcast_timer(void *arg)
-{
- unsigned long reason = (unsigned long)arg;
- int cpu = raw_smp_processor_id();
-
- reason = reason ?
- CLOCK_EVT_NOTIFY_BROADCAST_ON : CLOCK_EVT_NOTIFY_BROADCAST_OFF;
-
- clockevents_notify(reason, &cpu);
-}
-
static int lpm_cpu_callback(struct notifier_block *cpu_nb,
unsigned long action, void *hcpu)
{
cluster_unprepare(cluster, get_cpu_mask((unsigned int) cpu),
NR_LPM_LEVELS, false);
break;
- case CPU_ONLINE:
- smp_call_function_single(cpu, setup_broadcast_timer,
- (void *)true, 1);
- break;
default:
break;
}
int cpu;
int next_cpu = raw_smp_processor_id();
ktime_t next_event;
- struct tick_device *td;
struct cpumask online_cpus_in_cluster;
next_event.tv64 = KTIME_MAX;
&cluster->num_children_in_sync, cpu_online_mask);
for_each_cpu(cpu, &online_cpus_in_cluster) {
- td = &per_cpu(tick_cpu_device, cpu);
- if (td->evtdev->next_event.tv64 < next_event.tv64) {
- next_event.tv64 = td->evtdev->next_event.tv64;
+ ktime_t *next_event_c;
+
+ next_event_c = get_next_event_cpu(cpu);
+ if (next_event_c->tv64 < next_event.tv64) {
+ next_event.tv64 = next_event_c->tv64;
next_cpu = cpu;
}
}
/* Notify cluster enter event after successfully config completion */
cluster_notify(cluster, level, true);
- sched_set_cluster_dstate(&cluster->child_cpus, idx, 0, 0);
-
cluster->last_level = idx;
return 0;
BUG_ON(ret);
}
- sched_set_cluster_dstate(&cluster->child_cpus, 0, 0, 0);
cluster_notify(cluster, &cluster->levels[last_level], false);
cluster_unprepare(cluster->parent, &cluster->child_cpus,
bool from_idle)
{
struct lpm_cpu_level *cpu_level = &cluster->cpu->levels[cpu_index];
- unsigned int cpu = raw_smp_processor_id();
bool jtag_save_restore =
cluster->cpu->levels[cpu_index].jtag_save_restore;
*/
if (from_idle && (cpu_level->use_bc_timer ||
(cpu_index >= cluster->min_child_level)))
- clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
+ tick_broadcast_enter();
if (from_idle && ((cpu_level->mode == MSM_PM_SLEEP_MODE_POWER_COLLAPSE)
|| (cpu_level->mode ==
bool from_idle)
{
struct lpm_cpu_level *cpu_level = &cluster->cpu->levels[cpu_index];
- unsigned int cpu = raw_smp_processor_id();
bool jtag_save_restore =
cluster->cpu->levels[cpu_index].jtag_save_restore;
if (from_idle && (cpu_level->use_bc_timer ||
(cpu_index >= cluster->min_child_level)))
- clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
+ tick_broadcast_exit();
if (from_idle && ((cpu_level->mode == MSM_PM_SLEEP_MODE_POWER_COLLAPSE)
|| (cpu_level->mode ==
}
#if !defined(CONFIG_CPU_V7)
+#include <asm/cpuidle.h>
bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle)
{
/*
update_debug_pc_event(CPU_ENTER, state_id,
0xdeaffeed, 0xdeaffeed, true);
stop_critical_timings();
- success = !cpu_suspend(state_id);
+ success = !arm_cpuidle_suspend(state_id);
start_critical_timings();
update_debug_pc_event(CPU_EXIT, state_id,
success, 0xdeaffeed, true);
trace_cpu_idle_rcuidle(idx, dev->cpu);
pwr_params = &cluster->cpu->levels[idx].pwr;
- sched_set_cpu_cstate(smp_processor_id(), idx + 1,
- pwr_params->energy_overhead, pwr_params->latency_us);
trace_cpu_idle_enter(idx);
cluster_unprepare(cluster, cpumask, idx, true);
cpu_unprepare(cluster, idx, true);
- sched_set_cpu_cstate(smp_processor_id(), 0, 0, 0);
time = ktime_to_ns(ktime_get()) - time;
do_div(time, 1000);
* how late lpm_levels gets initialized.
*/
register_hotcpu_notifier(&lpm_cpu_nblk);
- get_cpu();
- on_each_cpu(setup_broadcast_timer, (void *)true, 1);
- put_cpu();
suspend_set_ops(&lpm_suspend_ops);
hrtimer_init(&lpm_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);