Loading drivers/acpi/processor_driver.c +0 −7 Original line number Diff line number Diff line Loading @@ -427,18 +427,11 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb, * Initialize missing things */ if (pr->flags.need_hotplug_init) { struct cpuidle_driver *idle_driver = cpuidle_get_driver(); printk(KERN_INFO "Will online and init hotplugged " "CPU: %d\n", pr->id); WARN(acpi_processor_start(pr), "Failed to start CPU:" " %d\n", pr->id); pr->flags.need_hotplug_init = 0; if (idle_driver && !strcmp(idle_driver->name, "intel_idle")) { intel_idle_cpu_init(pr->id); } /* Normal CPU soft online event */ } else { acpi_processor_ppc_has_changed(pr, 0); Loading drivers/acpi/processor_idle.c +1 −38 Original line number Diff line number Diff line Loading @@ -221,10 +221,6 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif /* * Suspend / resume control */ static int acpi_idle_suspend; static u32 saved_bm_rld; static void acpi_idle_bm_rld_save(void) Loading @@ -243,21 +239,13 @@ static void acpi_idle_bm_rld_restore(void) int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) { if (acpi_idle_suspend == 1) return 0; acpi_idle_bm_rld_save(); acpi_idle_suspend = 1; return 0; } int acpi_processor_resume(struct acpi_device * device) { if (acpi_idle_suspend == 0) return 0; acpi_idle_bm_rld_restore(); acpi_idle_suspend = 0; return 0; } Loading Loading @@ -595,7 +583,6 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, */ cx->valid = 1; cx->latency_ticks = cx->latency; /* * On older chipsets, BM_RLD needs to be set * in order for Bus Master activity to wake the Loading Loading @@ -628,7 +615,6 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) if (!cx->address) break; cx->valid = 1; cx->latency_ticks = cx->latency; /* Normalize latency */ break; case ACPI_STATE_C3: Loading Loading @@ -763,11 +749,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, local_irq_disable(); if (acpi_idle_suspend) { local_irq_enable(); cpu_relax(); return -EBUSY; } lapic_timer_state_broadcast(pr, cx, 1); kt1 = ktime_get_real(); Loading @@ -779,7 +760,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, dev->last_residency = (int)idle_time; local_irq_enable(); cx->usage++; lapic_timer_state_broadcast(pr, cx, 0); return index; Loading Loading @@ -838,11 +818,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, local_irq_disable(); if (acpi_idle_suspend) { local_irq_enable(); cpu_relax(); return -EBUSY; } if (cx->entry_method != ACPI_CSTATE_FFH) { current_thread_info()->status &= ~TS_POLLING; Loading Loading @@ -887,10 +862,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, if (cx->entry_method != ACPI_CSTATE_FFH) current_thread_info()->status |= TS_POLLING; cx->usage++; lapic_timer_state_broadcast(pr, cx, 0); cx->time += idle_time; return index; } Loading Loading @@ -928,7 +900,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, drv, drv->safe_state_index); } else { local_irq_disable(); if (!acpi_idle_suspend) acpi_safe_halt(); local_irq_enable(); return -EBUSY; Loading @@ -937,11 +908,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, local_irq_disable(); if (acpi_idle_suspend) { local_irq_enable(); cpu_relax(); return -EBUSY; } if (cx->entry_method != ACPI_CSTATE_FFH) { current_thread_info()->status &= ~TS_POLLING; Loading Loading @@ -1014,10 +980,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, if (cx->entry_method != ACPI_CSTATE_FFH) current_thread_info()->status |= TS_POLLING; cx->usage++; lapic_timer_state_broadcast(pr, cx, 0); cx->time += idle_time; return index; } Loading drivers/base/power/main.c +3 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ #include <linux/sched.h> #include <linux/async.h> #include <linux/suspend.h> #include <linux/cpuidle.h> #include "../base.h" #include "power.h" Loading Loading @@ -467,6 +467,7 @@ static void dpm_resume_noirq(pm_message_t state) mutex_unlock(&dpm_list_mtx); dpm_show_time(starttime, state, "noirq"); resume_device_irqs(); cpuidle_resume(); } /** Loading Loading @@ -867,6 +868,7 @@ static int dpm_suspend_noirq(pm_message_t state) ktime_t starttime = ktime_get(); int error = 0; cpuidle_pause(); suspend_device_irqs(); mutex_lock(&dpm_list_mtx); while (!list_empty(&dpm_late_early_list)) { Loading drivers/cpuidle/cpuidle.c +16 −1 Original line number Diff line number Diff line Loading @@ -201,6 +201,22 @@ void cpuidle_resume_and_unlock(void) EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock); /* Currently used in suspend/resume path to suspend cpuidle */ void cpuidle_pause(void) { mutex_lock(&cpuidle_lock); cpuidle_uninstall_idle_handler(); mutex_unlock(&cpuidle_lock); } /* Currently used in suspend/resume path to resume cpuidle */ void cpuidle_resume(void) { mutex_lock(&cpuidle_lock); cpuidle_install_idle_handler(); mutex_unlock(&cpuidle_lock); } /** * cpuidle_wrap_enter - performs timekeeping and irqen around enter function * @dev: pointer to a valid cpuidle_device object Loading Loading @@ -265,7 +281,6 @@ static void poll_idle_init(struct cpuidle_driver *drv) state->power_usage = -1; state->flags = 0; state->enter = poll_idle; state->disable = 0; } #else static void poll_idle_init(struct cpuidle_driver *drv) {} Loading drivers/cpuidle/driver.c +28 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ static struct cpuidle_driver *cpuidle_curr_driver; DEFINE_SPINLOCK(cpuidle_driver_lock); int cpuidle_driver_refcount; static void __cpuidle_register_driver(struct cpuidle_driver *drv) { Loading Loading @@ -89,8 +90,34 @@ void cpuidle_unregister_driver(struct cpuidle_driver *drv) } spin_lock(&cpuidle_driver_lock); if (!WARN_ON(cpuidle_driver_refcount > 0)) cpuidle_curr_driver = NULL; spin_unlock(&cpuidle_driver_lock); } EXPORT_SYMBOL_GPL(cpuidle_unregister_driver); struct cpuidle_driver *cpuidle_driver_ref(void) { struct cpuidle_driver *drv; spin_lock(&cpuidle_driver_lock); drv = cpuidle_curr_driver; cpuidle_driver_refcount++; spin_unlock(&cpuidle_driver_lock); return drv; } void cpuidle_driver_unref(void) { spin_lock(&cpuidle_driver_lock); if (!WARN_ON(cpuidle_driver_refcount <= 0)) cpuidle_driver_refcount--; spin_unlock(&cpuidle_driver_lock); } Loading
drivers/acpi/processor_driver.c +0 −7 Original line number Diff line number Diff line Loading @@ -427,18 +427,11 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb, * Initialize missing things */ if (pr->flags.need_hotplug_init) { struct cpuidle_driver *idle_driver = cpuidle_get_driver(); printk(KERN_INFO "Will online and init hotplugged " "CPU: %d\n", pr->id); WARN(acpi_processor_start(pr), "Failed to start CPU:" " %d\n", pr->id); pr->flags.need_hotplug_init = 0; if (idle_driver && !strcmp(idle_driver->name, "intel_idle")) { intel_idle_cpu_init(pr->id); } /* Normal CPU soft online event */ } else { acpi_processor_ppc_has_changed(pr, 0); Loading
drivers/acpi/processor_idle.c +1 −38 Original line number Diff line number Diff line Loading @@ -221,10 +221,6 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, #endif /* * Suspend / resume control */ static int acpi_idle_suspend; static u32 saved_bm_rld; static void acpi_idle_bm_rld_save(void) Loading @@ -243,21 +239,13 @@ static void acpi_idle_bm_rld_restore(void) int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) { if (acpi_idle_suspend == 1) return 0; acpi_idle_bm_rld_save(); acpi_idle_suspend = 1; return 0; } int acpi_processor_resume(struct acpi_device * device) { if (acpi_idle_suspend == 0) return 0; acpi_idle_bm_rld_restore(); acpi_idle_suspend = 0; return 0; } Loading Loading @@ -595,7 +583,6 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, */ cx->valid = 1; cx->latency_ticks = cx->latency; /* * On older chipsets, BM_RLD needs to be set * in order for Bus Master activity to wake the Loading Loading @@ -628,7 +615,6 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) if (!cx->address) break; cx->valid = 1; cx->latency_ticks = cx->latency; /* Normalize latency */ break; case ACPI_STATE_C3: Loading Loading @@ -763,11 +749,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, local_irq_disable(); if (acpi_idle_suspend) { local_irq_enable(); cpu_relax(); return -EBUSY; } lapic_timer_state_broadcast(pr, cx, 1); kt1 = ktime_get_real(); Loading @@ -779,7 +760,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, dev->last_residency = (int)idle_time; local_irq_enable(); cx->usage++; lapic_timer_state_broadcast(pr, cx, 0); return index; Loading Loading @@ -838,11 +818,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, local_irq_disable(); if (acpi_idle_suspend) { local_irq_enable(); cpu_relax(); return -EBUSY; } if (cx->entry_method != ACPI_CSTATE_FFH) { current_thread_info()->status &= ~TS_POLLING; Loading Loading @@ -887,10 +862,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, if (cx->entry_method != ACPI_CSTATE_FFH) current_thread_info()->status |= TS_POLLING; cx->usage++; lapic_timer_state_broadcast(pr, cx, 0); cx->time += idle_time; return index; } Loading Loading @@ -928,7 +900,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, drv, drv->safe_state_index); } else { local_irq_disable(); if (!acpi_idle_suspend) acpi_safe_halt(); local_irq_enable(); return -EBUSY; Loading @@ -937,11 +908,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, local_irq_disable(); if (acpi_idle_suspend) { local_irq_enable(); cpu_relax(); return -EBUSY; } if (cx->entry_method != ACPI_CSTATE_FFH) { current_thread_info()->status &= ~TS_POLLING; Loading Loading @@ -1014,10 +980,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, if (cx->entry_method != ACPI_CSTATE_FFH) current_thread_info()->status |= TS_POLLING; cx->usage++; lapic_timer_state_broadcast(pr, cx, 0); cx->time += idle_time; return index; } Loading
drivers/base/power/main.c +3 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ #include <linux/sched.h> #include <linux/async.h> #include <linux/suspend.h> #include <linux/cpuidle.h> #include "../base.h" #include "power.h" Loading Loading @@ -467,6 +467,7 @@ static void dpm_resume_noirq(pm_message_t state) mutex_unlock(&dpm_list_mtx); dpm_show_time(starttime, state, "noirq"); resume_device_irqs(); cpuidle_resume(); } /** Loading Loading @@ -867,6 +868,7 @@ static int dpm_suspend_noirq(pm_message_t state) ktime_t starttime = ktime_get(); int error = 0; cpuidle_pause(); suspend_device_irqs(); mutex_lock(&dpm_list_mtx); while (!list_empty(&dpm_late_early_list)) { Loading
drivers/cpuidle/cpuidle.c +16 −1 Original line number Diff line number Diff line Loading @@ -201,6 +201,22 @@ void cpuidle_resume_and_unlock(void) EXPORT_SYMBOL_GPL(cpuidle_resume_and_unlock); /* Currently used in suspend/resume path to suspend cpuidle */ void cpuidle_pause(void) { mutex_lock(&cpuidle_lock); cpuidle_uninstall_idle_handler(); mutex_unlock(&cpuidle_lock); } /* Currently used in suspend/resume path to resume cpuidle */ void cpuidle_resume(void) { mutex_lock(&cpuidle_lock); cpuidle_install_idle_handler(); mutex_unlock(&cpuidle_lock); } /** * cpuidle_wrap_enter - performs timekeeping and irqen around enter function * @dev: pointer to a valid cpuidle_device object Loading Loading @@ -265,7 +281,6 @@ static void poll_idle_init(struct cpuidle_driver *drv) state->power_usage = -1; state->flags = 0; state->enter = poll_idle; state->disable = 0; } #else static void poll_idle_init(struct cpuidle_driver *drv) {} Loading
drivers/cpuidle/driver.c +28 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ static struct cpuidle_driver *cpuidle_curr_driver; DEFINE_SPINLOCK(cpuidle_driver_lock); int cpuidle_driver_refcount; static void __cpuidle_register_driver(struct cpuidle_driver *drv) { Loading Loading @@ -89,8 +90,34 @@ void cpuidle_unregister_driver(struct cpuidle_driver *drv) } spin_lock(&cpuidle_driver_lock); if (!WARN_ON(cpuidle_driver_refcount > 0)) cpuidle_curr_driver = NULL; spin_unlock(&cpuidle_driver_lock); } EXPORT_SYMBOL_GPL(cpuidle_unregister_driver); struct cpuidle_driver *cpuidle_driver_ref(void) { struct cpuidle_driver *drv; spin_lock(&cpuidle_driver_lock); drv = cpuidle_curr_driver; cpuidle_driver_refcount++; spin_unlock(&cpuidle_driver_lock); return drv; } void cpuidle_driver_unref(void) { spin_lock(&cpuidle_driver_lock); if (!WARN_ON(cpuidle_driver_refcount <= 0)) cpuidle_driver_refcount--; spin_unlock(&cpuidle_driver_lock); }