diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 11:15:40 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 11:15:40 -0400 |
| commit | ab86e974f04b1cd827a9c7c35273834ebcd9ab38 (patch) | |
| tree | 41df33732d2700d6d57d1e7ab3f430942f09ffcc | |
| parent | 8700c95adb033843fc163d112b9d21d4fda78018 (diff) | |
| parent | 6f7a05d7018de222e40ca003721037a530979974 (diff) | |
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core timer updates from Ingo Molnar:
"The main changes in this cycle's merge are:
- Implement shadow timekeeper to shorten in kernel reader side
blocking, by Thomas Gleixner.
- Posix timers enhancements by Pavel Emelyanov:
- allocate timer ID per process, so that exact timer ID allocations
can be re-created be checkpoint/restore code.
- debuggability and tooling (/proc/PID/timers, etc.) improvements.
- suspend/resume enhancements by Feng Tang: on certain new Intel Atom
processors (Penwell and Cloverview), there is a feature that the
TSC won't stop in S3 state, so the TSC value won't be reset to 0
after resume. This can be taken advantage of by the generic via
the CLOCK_SOURCE_SUSPEND_NONSTOP flag: instead of using the RTC to
recover/approximate sleep time, the main (and precise) clocksource
can be used.
- Fix /proc/timer_list for 4096 CPUs by Nathan Zimmer: on so many
CPUs the file goes beyond 4MB of size and thus the current
simplistic seqfile approach fails. Convert /proc/timer_list to a
proper seq_file with its own iterator.
- Cleanups and refactorings of the core timekeeping code by John
Stultz.
- International Atomic Clock time is managed by the NTP code
internally currently but not exposed externally. Separate the TAI
code out and add CLOCK_TAI support and TAI support to the hrtimer
and posix-timer code, by John Stultz.
- Add deep idle support enhacement to the broadcast clockevents core
timer code, by Daniel Lezcano: add an opt-in CLOCK_EVT_FEAT_DYNIRQ
clockevents feature (which will be utilized by future clockevents
driver updates), which allows the use of IRQ affinities to avoid
spurious wakeups of idle CPUs - the right CPU with an expiring
timer will be woken.
- Add new ARM bcm281xx clocksource driver, by Christian Daudt
- ... various other fixes and cleanups"
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (52 commits)
clockevents: Set dummy handler on CPU_DEAD shutdown
timekeeping: Update tk->cycle_last in resume
posix-timers: Remove unused variable
clockevents: Switch into oneshot mode even if broadcast registered late
timer_list: Convert timer list to be a proper seq_file
timer_list: Split timer_list_show_tickdevices
posix-timers: Show sigevent info in proc file
posix-timers: Introduce /proc/PID/timers file
posix timers: Allocate timer id per process (v2)
timekeeping: Make sure to notify hrtimers when TAI offset changes
hrtimer: Fix ktime_add_ns() overflow on 32bit architectures
hrtimer: Add expiry time overflow check in hrtimer_interrupt
timekeeping: Shorten seq_count region
timekeeping: Implement a shadow timekeeper
timekeeping: Delay update of clock->cycle_last
timekeeping: Store cycle_last value in timekeeper struct as well
ntp: Remove ntp_lock, using the timekeeping locks to protect ntp state
timekeeping: Simplify tai updating from do_adjtimex
timekeeping: Hold timekeepering locks in do_adjtimex and hardpps
timekeeping: Move ADJ_SETOFFSET to top level do_adjtimex()
...
35 files changed, 1178 insertions, 385 deletions
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index bf02471d7e7c..f11289519c39 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig | |||
| @@ -6,6 +6,7 @@ config ARCH_BCM | |||
| 6 | select ARM_ERRATA_764369 if SMP | 6 | select ARM_ERRATA_764369 if SMP |
| 7 | select ARM_GIC | 7 | select ARM_GIC |
| 8 | select CPU_V7 | 8 | select CPU_V7 |
| 9 | select CLKSRC_OF | ||
| 9 | select GENERIC_CLOCKEVENTS | 10 | select GENERIC_CLOCKEVENTS |
| 10 | select GENERIC_TIME | 11 | select GENERIC_TIME |
| 11 | select GPIO_BCM | 12 | select GPIO_BCM |
diff --git a/arch/arm/mach-bcm/board_bcm.c b/arch/arm/mach-bcm/board_bcm.c index f0f9abafad29..259593540477 100644 --- a/arch/arm/mach-bcm/board_bcm.c +++ b/arch/arm/mach-bcm/board_bcm.c | |||
| @@ -16,14 +16,11 @@ | |||
| 16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
| 17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/irqchip.h> | 18 | #include <linux/irqchip.h> |
| 19 | #include <linux/clocksource.h> | ||
| 19 | 20 | ||
| 20 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
| 21 | #include <asm/mach/time.h> | 22 | #include <asm/mach/time.h> |
| 22 | 23 | ||
| 23 | static void timer_init(void) | ||
| 24 | { | ||
| 25 | } | ||
| 26 | |||
| 27 | 24 | ||
| 28 | static void __init board_init(void) | 25 | static void __init board_init(void) |
| 29 | { | 26 | { |
| @@ -35,7 +32,7 @@ static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, }; | |||
| 35 | 32 | ||
| 36 | DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor") | 33 | DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor") |
| 37 | .init_irq = irqchip_init, | 34 | .init_irq = irqchip_init, |
| 38 | .init_time = timer_init, | 35 | .init_time = clocksource_of_init, |
| 39 | .init_machine = board_init, | 36 | .init_machine = board_init, |
| 40 | .dt_compat = bcm11351_dt_compat, | 37 | .dt_compat = bcm11351_dt_compat, |
| 41 | MACHINE_END | 38 | MACHINE_END |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index d75b48c11be5..e93ccb9b1cc1 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -120,6 +120,7 @@ config X86 | |||
| 120 | select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION | 120 | select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION |
| 121 | select OLD_SIGACTION if X86_32 | 121 | select OLD_SIGACTION if X86_32 |
| 122 | select COMPAT_OLD_SIGACTION if IA32_EMULATION | 122 | select COMPAT_OLD_SIGACTION if IA32_EMULATION |
| 123 | select RTC_LIB | ||
| 123 | 124 | ||
| 124 | config INSTRUCTION_DECODER | 125 | config INSTRUCTION_DECODER |
| 125 | def_bool y | 126 | def_bool y |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index ac10df72925b..6ce479800258 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
| @@ -100,6 +100,7 @@ | |||
| 100 | #define X86_FEATURE_AMD_DCM (3*32+27) /* multi-node processor */ | 100 | #define X86_FEATURE_AMD_DCM (3*32+27) /* multi-node processor */ |
| 101 | #define X86_FEATURE_APERFMPERF (3*32+28) /* APERFMPERF */ | 101 | #define X86_FEATURE_APERFMPERF (3*32+28) /* APERFMPERF */ |
| 102 | #define X86_FEATURE_EAGER_FPU (3*32+29) /* "eagerfpu" Non lazy FPU restore */ | 102 | #define X86_FEATURE_EAGER_FPU (3*32+29) /* "eagerfpu" Non lazy FPU restore */ |
| 103 | #define X86_FEATURE_NONSTOP_TSC_S3 (3*32+30) /* TSC doesn't stop in S3 state */ | ||
| 103 | 104 | ||
| 104 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 105 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
| 105 | #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ | 106 | #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ |
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 1905ce98bee0..e7ae0d89e7e0 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
| @@ -96,6 +96,18 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | |||
| 96 | sched_clock_stable = 1; | 96 | sched_clock_stable = 1; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | /* Penwell and Cloverview have the TSC which doesn't sleep on S3 */ | ||
| 100 | if (c->x86 == 6) { | ||
| 101 | switch (c->x86_model) { | ||
| 102 | case 0x27: /* Penwell */ | ||
| 103 | case 0x35: /* Cloverview */ | ||
| 104 | set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3); | ||
| 105 | break; | ||
| 106 | default: | ||
| 107 | break; | ||
| 108 | } | ||
| 109 | } | ||
| 110 | |||
| 99 | /* | 111 | /* |
| 100 | * There is a known erratum on Pentium III and Core Solo | 112 | * There is a known erratum on Pentium III and Core Solo |
| 101 | * and Core Duo CPUs. | 113 | * and Core Duo CPUs. |
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index 2e8f3d3b5641..198eb201ed3b 100644 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <asm/x86_init.h> | 13 | #include <asm/x86_init.h> |
| 14 | #include <asm/time.h> | 14 | #include <asm/time.h> |
| 15 | #include <asm/mrst.h> | 15 | #include <asm/mrst.h> |
| 16 | #include <asm/rtc.h> | ||
| 16 | 17 | ||
| 17 | #ifdef CONFIG_X86_32 | 18 | #ifdef CONFIG_X86_32 |
| 18 | /* | 19 | /* |
| @@ -36,70 +37,24 @@ EXPORT_SYMBOL(rtc_lock); | |||
| 36 | * nowtime is written into the registers of the CMOS clock, it will | 37 | * nowtime is written into the registers of the CMOS clock, it will |
| 37 | * jump to the next second precisely 500 ms later. Check the Motorola | 38 | * jump to the next second precisely 500 ms later. Check the Motorola |
| 38 | * MC146818A or Dallas DS12887 data sheet for details. | 39 | * MC146818A or Dallas DS12887 data sheet for details. |
| 39 | * | ||
| 40 | * BUG: This routine does not handle hour overflow properly; it just | ||
| 41 | * sets the minutes. Usually you'll only notice that after reboot! | ||
| 42 | */ | 40 | */ |
| 43 | int mach_set_rtc_mmss(unsigned long nowtime) | 41 | int mach_set_rtc_mmss(unsigned long nowtime) |
| 44 | { | 42 | { |
| 45 | int real_seconds, real_minutes, cmos_minutes; | 43 | struct rtc_time tm; |
| 46 | unsigned char save_control, save_freq_select; | ||
| 47 | unsigned long flags; | ||
| 48 | int retval = 0; | 44 | int retval = 0; |
| 49 | 45 | ||
| 50 | spin_lock_irqsave(&rtc_lock, flags); | 46 | rtc_time_to_tm(nowtime, &tm); |
| 51 | 47 | if (!rtc_valid_tm(&tm)) { | |
| 52 | /* tell the clock it's being set */ | ||
