aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-26 11:15:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-26 11:15:03 -0400
commit39adff5f69d6849ca22353a88058c9f8630528c0 (patch)
treeb0c2d2de77ebc5c97fd19c29b81eeb03549553f8 /arch/s390/kernel
parent8a4a8918ed6e4a361f4df19f199bbc2d0a89a46c (diff)
parente35f95b36e43f67a6f806172555a152c11ea0a78 (diff)
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) time, s390: Get rid of compile warning dw_apb_timer: constify clocksource name time: Cleanup old CONFIG_GENERIC_TIME references that snuck in time: Change jiffies_to_clock_t() argument type to unsigned long alarmtimers: Fix error handling clocksource: Make watchdog reset lockless posix-cpu-timers: Cure SMP accounting oddities s390: Use direct ktime path for s390 clockevent device clockevents: Add direct ktime programming function clockevents: Make minimum delay adjustments configurable nohz: Remove "Switched to NOHz mode" debugging messages proc: Consider NO_HZ when printing idle and iowait times nohz: Make idle/iowait counter update conditional nohz: Fix update_ts_time_stat idle accounting cputime: Clean up cputime_to_usecs and usecs_to_cputime macros alarmtimers: Rework RTC device selection using class interface alarmtimers: Add try_to_cancel functionality alarmtimers: Add more refined alarm state tracking alarmtimers: Remove period from alarm structure alarmtimers: Remove interval cap limit hack ...
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r--arch/s390/kernel/time.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index dff933065ab6..8d65bd0383fc 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -109,10 +109,14 @@ static void fixup_clock_comparator(unsigned long long delta)
109 set_clock_comparator(S390_lowcore.clock_comparator); 109 set_clock_comparator(S390_lowcore.clock_comparator);
110} 110}
111 111
112static int s390_next_event(unsigned long delta, 112static int s390_next_ktime(ktime_t expires,
113 struct clock_event_device *evt) 113 struct clock_event_device *evt)
114{ 114{
115 S390_lowcore.clock_comparator = get_clock() + delta; 115 u64 nsecs;
116
117 nsecs = ktime_to_ns(ktime_sub(expires, ktime_get_monotonic_offset()));
118 do_div(nsecs, 125);
119 S390_lowcore.clock_comparator = TOD_UNIX_EPOCH + (nsecs << 9);
116 set_clock_comparator(S390_lowcore.clock_comparator); 120 set_clock_comparator(S390_lowcore.clock_comparator);
117 return 0; 121 return 0;
118} 122}
@@ -137,14 +141,15 @@ void init_cpu_timer(void)
137 cpu = smp_processor_id(); 141 cpu = smp_processor_id();
138 cd = &per_cpu(comparators, cpu); 142 cd = &per_cpu(comparators, cpu);
139 cd->name = "comparator"; 143 cd->name = "comparator";
140 cd->features = CLOCK_EVT_FEAT_ONESHOT; 144 cd->features = CLOCK_EVT_FEAT_ONESHOT |
145 CLOCK_EVT_FEAT_KTIME;
141 cd->mult = 16777; 146 cd->mult = 16777;
142 cd->shift = 12; 147 cd->shift = 12;
143 cd->min_delta_ns = 1; 148 cd->min_delta_ns = 1;
144 cd->max_delta_ns = LONG_MAX; 149 cd->max_delta_ns = LONG_MAX;
145 cd->rating = 400; 150 cd->rating = 400;
146 cd->cpumask = cpumask_of(cpu); 151 cd->cpumask = cpumask_of(cpu);
147 cd->set_next_event = s390_next_event; 152 cd->set_next_ktime = s390_next_ktime;
148 cd->set_mode = s390_set_mode; 153 cd->set_mode = s390_set_mode;
149 154
150 clockevents_register_device(cd); 155 clockevents_register_device(cd);