mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Ingo Molnar:
"The main changes in this cycle were:
- clockevents state machine cleanups and enhancements (Viresh Kumar)
- clockevents broadcast notifier horror to state machine conversion
and related cleanups (Thomas Gleixner, Rafael J Wysocki)
- clocksource and timekeeping core updates (John Stultz)
- clocksource driver updates and fixes (Ben Dooks, Dmitry Osipenko,
Hans de Goede, Laurent Pinchart, Maxime Ripard, Xunlei Pang)
- y2038 fixes (Xunlei Pang, John Stultz)
- NMI-safe ktime_get_raw_fast() and general refactoring of the clock
code, in preparation to perf's per event clock ID support (Peter
Zijlstra)
- generic sched/clock fixes, optimizations and cleanups (Daniel
Thompson)
- clockevents cpu_down() race fix (Preeti U Murthy)"
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (94 commits)
timers/PM: Drop unnecessary braces from tick_freeze()
timers/PM: Fix up tick_unfreeze()
timekeeping: Get rid of stale comment
clockevents: Cleanup dead cpu explicitely
clockevents: Make tick handover explicit
clockevents: Remove broadcast oneshot control leftovers
sched/idle: Use explicit broadcast oneshot control function
ARM: Tegra: Use explicit broadcast oneshot control function
ARM: OMAP: Use explicit broadcast oneshot control function
intel_idle: Use explicit broadcast oneshot control function
ACPI/idle: Use explicit broadcast control function
ACPI/PAD: Use explicit broadcast oneshot control function
x86/amd/idle, clockevents: Use explicit broadcast oneshot control functions
clockevents: Provide explicit broadcast oneshot control functions
clockevents: Remove the broadcast control leftovers
ARM: OMAP: Use explicit broadcast control function
intel_idle: Use explicit broadcast control function
cpuidle: Use explicit broadcast control function
ACPI/processor: Use explicit broadcast control function
ACPI/PAD: Use explicit broadcast control function
...
This commit is contained in:
commit
7fd56474db
66 changed files with 1849 additions and 1339 deletions
|
|
@ -26,7 +26,7 @@
|
|||
#include <linux/kthread.h>
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/clockchips.h>
|
||||
#include <linux/tick.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <asm/mwait.h>
|
||||
|
|
@ -41,8 +41,6 @@ static unsigned long power_saving_mwait_eax;
|
|||
|
||||
static unsigned char tsc_detected_unstable;
|
||||
static unsigned char tsc_marked_unstable;
|
||||
static unsigned char lapic_detected_unstable;
|
||||
static unsigned char lapic_marked_unstable;
|
||||
|
||||
static void power_saving_mwait_init(void)
|
||||
{
|
||||
|
|
@ -82,13 +80,10 @@ static void power_saving_mwait_init(void)
|
|||
*/
|
||||
if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
|
||||
tsc_detected_unstable = 1;
|
||||
if (!boot_cpu_has(X86_FEATURE_ARAT))
|
||||
lapic_detected_unstable = 1;
|
||||
break;
|
||||
default:
|
||||
/* TSC & LAPIC could halt in idle */
|
||||
/* TSC could halt in idle */
|
||||
tsc_detected_unstable = 1;
|
||||
lapic_detected_unstable = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -155,7 +150,6 @@ static int power_saving_thread(void *data)
|
|||
sched_setscheduler(current, SCHED_RR, ¶m);
|
||||
|
||||
while (!kthread_should_stop()) {
|
||||
int cpu;
|
||||
unsigned long expire_time;
|
||||
|
||||
try_to_freeze();
|
||||
|
|
@ -177,28 +171,15 @@ static int power_saving_thread(void *data)
|
|||
mark_tsc_unstable("TSC halts in idle");
|
||||
tsc_marked_unstable = 1;
|
||||
}
|
||||
if (lapic_detected_unstable && !lapic_marked_unstable) {
|
||||
int i;
|
||||
/* LAPIC could halt in idle, so notify users */
|
||||
for_each_online_cpu(i)
|
||||
clockevents_notify(
|
||||
CLOCK_EVT_NOTIFY_BROADCAST_ON,
|
||||
&i);
|
||||
lapic_marked_unstable = 1;
|
||||
}
|
||||
local_irq_disable();
|
||||
cpu = smp_processor_id();
|
||||
if (lapic_marked_unstable)
|
||||
clockevents_notify(
|
||||
CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
|
||||
tick_broadcast_enable();
|
||||
tick_broadcast_enter();
|
||||
stop_critical_timings();
|
||||
|
||||
mwait_idle_with_hints(power_saving_mwait_eax, 1);
|
||||
|
||||
start_critical_timings();
|
||||
if (lapic_marked_unstable)
|
||||
clockevents_notify(
|
||||
CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
|
||||
tick_broadcast_exit();
|
||||
local_irq_enable();
|
||||
|
||||
if (time_before(expire_time, jiffies)) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#include <linux/acpi.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/sched.h> /* need_resched() */
|
||||
#include <linux/clockchips.h>
|
||||
#include <linux/tick.h>
|
||||
#include <linux/cpuidle.h>
|
||||
#include <linux/syscore_ops.h>
|
||||
#include <acpi/processor.h>
|
||||
|
|
@ -157,12 +157,11 @@ static void lapic_timer_check_state(int state, struct acpi_processor *pr,
|
|||
static void __lapic_timer_propagate_broadcast(void *arg)
|
||||
{
|
||||
struct acpi_processor *pr = (struct acpi_processor *) arg;
|
||||
unsigned long reason;
|
||||
|
||||
reason = pr->power.timer_broadcast_on_state < INT_MAX ?
|
||||
CLOCK_EVT_NOTIFY_BROADCAST_ON : CLOCK_EVT_NOTIFY_BROADCAST_OFF;
|
||||
|
||||
clockevents_notify(reason, &pr->id);
|
||||
if (pr->power.timer_broadcast_on_state < INT_MAX)
|
||||
tick_broadcast_enable();
|
||||
else
|
||||
tick_broadcast_disable();
|
||||
}
|
||||
|
||||
static void lapic_timer_propagate_broadcast(struct acpi_processor *pr)
|
||||
|
|
@ -179,11 +178,10 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr,
|
|||
int state = cx - pr->power.states;
|
||||
|
||||
if (state >= pr->power.timer_broadcast_on_state) {
|
||||
unsigned long reason;
|
||||
|
||||
reason = broadcast ? CLOCK_EVT_NOTIFY_BROADCAST_ENTER :
|
||||
CLOCK_EVT_NOTIFY_BROADCAST_EXIT;
|
||||
clockevents_notify(reason, &pr->id);
|
||||
if (broadcast)
|
||||
tick_broadcast_enter();
|
||||
else
|
||||
tick_broadcast_exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue