Skip to content

Commit

Permalink
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip

Pull timer core updates from Thomas Gleixner:
 "The timer changes contain:

   - posix timer code consolidation and fixes for odd corner cases

   - sched_clock implementation moved from ARM to core code to avoid
     duplication by other architectures

   - alarm timer updates

   - clocksource and clockevents unregistration facilities

   - clocksource/events support for new hardware

   - precise nanoseconds RTC readout (Xen feature)

   - generic support for Xen suspend/resume oddities

   - the usual lot of fixes and cleanups all over the place

  The parts which touch other areas (ARM/XEN) have been coordinated with
  the relevant maintainers.  Though this results in an handful of
  trivial to solve merge conflicts, which we preferred over nasty cross
  tree merge dependencies.

  The patches which have been committed in the last few days are bug
  fixes plus the posix timer lot.  The latter was in akpms queue and
  next for quite some time; they just got forgotten and Frederic
  collected them last minute."

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (59 commits)
  hrtimer: Remove unused variable
  hrtimers: Move SMP function call to thread context
  clocksource: Reselect clocksource when watchdog validated high-res capability
  posix-cpu-timers: don't account cpu timer after stopped thread runtime accounting
  posix_timers: fix racy timer delta caching on task exit
  posix-timers: correctly get dying task time sample in posix_cpu_timer_schedule()
  selftests: add basic posix timers selftests
  posix_cpu_timers: consolidate expired timers check
  posix_cpu_timers: consolidate timer list cleanups
  posix_cpu_timer: consolidate expiry time type
  tick: Sanitize broadcast control logic
  tick: Prevent uncontrolled switch to oneshot mode
  tick: Make oneshot broadcast robust vs. CPU offlining
  x86: xen: Sync the CMOS RTC as well as the Xen wallclock
  x86: xen: Sync the wallclock when the system time is set
  timekeeping: Indicate that clock was set in the pvclock gtod notifier
  timekeeping: Pass flags instead of multiple bools to timekeeping_update()
  xen: Remove clock_was_set() call in the resume path
  hrtimers: Support resuming with two or more CPUs online (but stopped)
  timer: Fix jiffies wrap behavior of round_jiffies_common()
  ...
  • Loading branch information
torvalds committed Jul 6, 2013
2 parents 8b70a90 + 73b0cd6 commit 21884a8
Show file tree
Hide file tree
Showing 79 changed files with 2,050 additions and 703 deletions.
33 changes: 33 additions & 0 deletions Documentation/devicetree/bindings/timer/lsi,zevio-timer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
TI-NSPIRE timer

Required properties:

- compatible : should be "lsi,zevio-timer".
- reg : The physical base address and size of the timer (always first).
- clocks: phandle to the source clock.

Optional properties:

- interrupts : The interrupt number of the first timer.
- reg : The interrupt acknowledgement registers
(always after timer base address)

If any of the optional properties are not given, the timer is added as a
clock-source only.

Example:

timer {
compatible = "lsi,zevio-timer";
reg = <0x900D0000 0x1000>, <0x900A0020 0x8>;
interrupts = <19>;
clocks = <&timer_clk>;
};

Example (no clock-events):

timer {
compatible = "lsi,zevio-timer";
reg = <0x900D0000 0x1000>;
clocks = <&timer_clk>;
};
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ config ARM
select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW
select GENERIC_PCI_IOMAP
select GENERIC_SCHED_CLOCK
select GENERIC_SMP_IDLE_THREAD
select GENERIC_IDLE_POLL_SETUP
select GENERIC_STRNCPY_FROM_USER
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/common/timer-sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/sched_clock.h>

#include <asm/sched_clock.h>
#include <asm/hardware/arm_timer.h>
#include <asm/hardware/timer-sp.h>

Expand Down
18 changes: 3 additions & 15 deletions arch/arm/include/asm/sched_clock.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
/*
* sched_clock.h: support for extending counters to full 64-bit ns counter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
/* You shouldn't include this file. Use linux/sched_clock.h instead.
* Temporary file until all asm/sched_clock.h users are gone
*/
#ifndef ASM_SCHED_CLOCK
#define ASM_SCHED_CLOCK

extern void sched_clock_postinit(void);
extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);

extern unsigned long long (*sched_clock_func)(void);

#endif
#include <linux/sched_clock.h>
2 changes: 1 addition & 1 deletion arch/arm/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CFLAGS_REMOVE_return_address.o = -pg
# Object file lists.

obj-y := elf.o entry-common.o irq.o opcodes.o \
process.o ptrace.o return_address.o sched_clock.o \
process.o ptrace.o return_address.o \
setup.o signal.o stacktrace.o sys_arm.o time.o traps.o

obj-$(CONFIG_ATAGS) += atags_parse.o
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/arch_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/sched_clock.h>

#include <asm/delay.h>
#include <asm/sched_clock.h>

#include <clocksource/arm_arch_timer.h>

Expand Down
4 changes: 1 addition & 3 deletions arch/arm/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#include <linux/timer.h>
#include <linux/clocksource.h>
#include <linux/irq.h>
#include <linux/sched_clock.h>

#include <asm/thread_info.h>
#include <asm/sched_clock.h>
#include <asm/stacktrace.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
Expand Down Expand Up @@ -120,6 +120,4 @@ void __init time_init(void)
machine_desc->init_time();
else
clocksource_of_init();

sched_clock_postinit();
}
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/sched_clock.h>

#include <asm/sched_clock.h>
#include <asm/mach/irq.h>
#include <asm/mach/time.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <linux/clockchips.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/sched_clock.h>

#include <asm/sched_clock.h>
#include <asm/mach/time.h>

#include "common.h"
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-integrator/integrator_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
#include <linux/stat.h>
#include <linux/sys_soc.h>
#include <linux/termios.h>
#include <linux/sched_clock.h>

#include <mach/hardware.h>
#include <mach/platform.h>
#include <asm/hardware/arm_timer.h>
#include <asm/setup.h>
#include <asm/param.h> /* HZ */
#include <asm/mach-types.h>
#include <asm/sched_clock.h>

#include <mach/lm.h>
#include <mach/irqs.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ixp4xx/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/export.h>
#include <linux/gpio.h>
#include <linux/cpu.h>
#include <linux/sched_clock.h>

#include <mach/udc.h>
#include <mach/hardware.h>
Expand All @@ -38,7 +39,6 @@
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/irq.h>
#include <asm/sched_clock.h>
#include <asm/system_misc.h>

#include <asm/mach/map.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/sched_clock.h>

#include <asm/sched_clock.h>
#include <mach/addr-map.h>
#include <mach/regs-timers.h>
#include <mach/regs-apbc.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/sched_clock.h>

#include <asm/mach/time.h>
#include <asm/localtimer.h>
#include <asm/sched_clock.h>

#include "common.h"

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <linux/io.h>
#include <linux/sched_clock.h>

#include <asm/irq.h>
#include <asm/sched_clock.h>

#include <mach/hardware.h>
#include <asm/mach/irq.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/platform_data/dmtimer-omap.h>
#include <linux/sched_clock.h>

#include <asm/mach/time.h>
#include <asm/smp_twd.h>
#include <asm/sched_clock.h>

#include "omap_hwmod.h"
#include "omap_device.h"
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/clockchips.h>
#include <linux/sched_clock.h>

#include <asm/div64.h>
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
#include <asm/sched_clock.h>
#include <mach/regs-ost.h>
#include <mach/irqs.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-sa1100/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include <linux/irq.h>
#include <linux/timex.h>
#include <linux/clockchips.h>
#include <linux/sched_clock.h>

#include <asm/mach/time.h>
#include <asm/sched_clock.h>
#include <mach/hardware.h>
#include <mach/irqs.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-u300/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include <linux/delay.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/sched_clock.h>

/* Generic stuff */
#include <asm/sched_clock.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-iop/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <linux/export.h>
#include <linux/sched_clock.h>
#include <mach/hardware.h>
#include <asm/irq.h>
#include <asm/sched_clock.h>
#include <asm/uaccess.h>
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-omap/counter_32k.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include <linux/err.h>
#include <linux/io.h>
#include <linux/clocksource.h>
#include <linux/sched_clock.h>

#include <asm/mach/time.h>
#include <asm/sched_clock.h>

#include <plat/counter-32k.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-orion/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <linux/clockchips.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <asm/sched_clock.h>
#include <linux/sched_clock.h>

/*
* MBus bridge block registers.
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-samsung/samsung-time.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#include <linux/clk.h>
#include <linux/clockchips.h>
#include <linux/platform_device.h>
#include <linux/sched_clock.h>

#include <asm/smp_twd.h>
#include <asm/mach/time.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/sched_clock.h>

#include <mach/map.h>
#include <plat/devs.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-versatile/sched-clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
*/
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/sched_clock.h>

#include <asm/sched_clock.h>
#include <plat/sched_clock.h>

static void __iomem *ctr;
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/include/asm/mc146818rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ static inline unsigned char current_lock_cmos_reg(void)
unsigned char rtc_cmos_read(unsigned char addr);
void rtc_cmos_write(unsigned char val, unsigned char addr);

extern int mach_set_rtc_mmss(unsigned long nowtime);
extern unsigned long mach_get_cmos_time(void);
extern int mach_set_rtc_mmss(const struct timespec *now);
extern void mach_get_cmos_time(struct timespec *now);

#define RTC_IRQ 8

Expand Down
4 changes: 2 additions & 2 deletions arch/x86/include/asm/mrst-vrtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

extern unsigned char vrtc_cmos_read(unsigned char reg);
extern void vrtc_cmos_write(unsigned char val, unsigned char reg);
extern unsigned long vrtc_get_time(void);
extern int vrtc_set_mmss(unsigned long nowtime);
extern void vrtc_get_time(struct timespec *now);
extern int vrtc_set_mmss(const struct timespec *now);

#endif
6 changes: 4 additions & 2 deletions arch/x86/include/asm/x86_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ struct x86_cpuinit_ops {
void (*fixup_cpu_id)(struct cpuinfo_x86 *c, int node);
};

struct timespec;

/**
* struct x86_platform_ops - platform specific runtime functions
* @calibrate_tsc: calibrate TSC
Expand All @@ -156,8 +158,8 @@ struct x86_cpuinit_ops {
*/
struct x86_platform_ops {
unsigned long (*calibrate_tsc)(void);
unsigned long (*get_wallclock)(void);
int (*set_wallclock)(unsigned long nowtime);
void (*get_wallclock)(struct timespec *ts);
int (*set_wallclock)(const struct timespec *ts);
void (*iommu_shutdown)(void);
bool (*is_untracked_pat_range)(u64 start, u64 end);
void (*nmi_init)(void);
Expand Down
9 changes: 3 additions & 6 deletions arch/x86/kernel/kvmclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ static struct pvclock_wall_clock wall_clock;
* have elapsed since the hypervisor wrote the data. So we try to account for
* that with system time
*/
static unsigned long kvm_get_wallclock(void)
static void kvm_get_wallclock(struct timespec *now)
{
struct pvclock_vcpu_time_info *vcpu_time;
struct timespec ts;
int low, high;
int cpu;

Expand All @@ -64,14 +63,12 @@ static unsigned long kvm_get_wallclock(void)
cpu = smp_processor_id();

vcpu_time = &hv_clock[cpu].pvti;
pvclock_read_wallclock(&wall_clock, vcpu_time, &ts);
pvclock_read_wallclock(&wall_clock, vcpu_time, now);

preempt_enable();

return ts.tv_sec;
}

static int kvm_set_wallclock(unsigned long now)
static int kvm_set_wallclock(const struct timespec *now)
{
return -1;
}
Expand Down
Loading

0 comments on commit 21884a8

Please sign in to comment.