Beispiel #1
0
static void freeze_enter(void)
{
	spin_lock_irq(&suspend_freeze_lock);
	if (pm_wakeup_pending())
		goto out;

	suspend_freeze_state = FREEZE_STATE_ENTER;
	spin_unlock_irq(&suspend_freeze_lock);

	get_online_cpus();
	cpuidle_resume();

	/* Push all the CPUs into the idle loop. */
	wake_up_all_idle_cpus();
	pr_debug("PM: suspend-to-idle\n");
	/* Make the current CPU wait so it can enter the idle loop too. */
	wait_event(suspend_freeze_wait_head,
		   suspend_freeze_state == FREEZE_STATE_WAKE);
	pr_debug("PM: resume from suspend-to-idle\n");

	cpuidle_pause();
	put_online_cpus();

	spin_lock_irq(&suspend_freeze_lock);

 out:
	suspend_freeze_state = FREEZE_STATE_NONE;
	spin_unlock_irq(&suspend_freeze_lock);
}
Beispiel #2
0
static void s2idle_enter(void)
{
	trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, true);

	raw_spin_lock_irq(&s2idle_lock);
	if (pm_wakeup_pending())
		goto out;

	s2idle_state = S2IDLE_STATE_ENTER;
	raw_spin_unlock_irq(&s2idle_lock);

	get_online_cpus();
	cpuidle_resume();

	/* Push all the CPUs into the idle loop. */
	wake_up_all_idle_cpus();
	/* Make the current CPU wait so it can enter the idle loop too. */
	swait_event_exclusive(s2idle_wait_head,
		    s2idle_state == S2IDLE_STATE_WAKE);

	cpuidle_pause();
	put_online_cpus();

	raw_spin_lock_irq(&s2idle_lock);

 out:
	s2idle_state = S2IDLE_STATE_NONE;
	raw_spin_unlock_irq(&s2idle_lock);

	trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, false);
}
Beispiel #3
0
static void freeze_enter(void)
{
	cpuidle_use_deepest_state(true);
	cpuidle_resume();
	wait_event(suspend_freeze_wait_head, suspend_freeze_wake);
	cpuidle_pause();
	cpuidle_use_deepest_state(false);
}
static int platform_cpu_up_notify (struct notifier_block *nfb,
                    unsigned long status, void *cpuid)
{
    unsigned int cpu = (unsigned int)cpuid;

    /*printk(KERN_INFO"[CPU %d] %s : cpu %d change to status %ld.\n", this_cpu, __FUNCTION__, cpu, status);*/

    switch(status){
        case CPU_UP_PREPARE:
        case CPU_UP_PREPARE_FROZEN:
            cpuidle_pause();
#ifdef ACPU_32_BIT_CPUILDE
            clr_cluster_idle_bit(cpuid>=4?1:0);
#endif
		if((cpu>3)&&(g_cluster_pd_stat[1] == 1))
		{
			platform_cluster_power_up(1);
		}
		if((cpu<=3)&&(g_cluster_pd_stat[0] == 1))
		{
			platform_cluster_power_up(0);
		}
            printk(KERN_INFO"platform_cpu_power_on begin...\n");
            platform_cpu_power_on(cpu);
            printk(KERN_INFO"platform_cpu_power_on end...\n");
            break;
        case CPU_ONLINE:
        case CPU_ONLINE_FROZEN:
        case CPU_UP_CANCELED:
        case CPU_UP_CANCELED_FROZEN:
            cpuidle_resume();
            break;
        default:
            /*just pass other event*/
            break;

    }
    return NOTIFY_DONE;
}
static void freeze_enter(void)
{
	cpuidle_resume();
	wait_event(suspend_freeze_wait_head, suspend_freeze_wake);
	cpuidle_pause();
}