aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-06-16 13:22:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-06-16 13:22:56 -0400
commitefba92d58fa37d714d665deddb5cc6458b39bb88 (patch)
tree3f7c598b41b340b98bbf9bd042fafe039c9269bd
parentf763cf8e47d3aa4b081e0537d060c12818de8d0f (diff)
parente3ff9c3678b4d80e22d2557b68726174578eaf52 (diff)
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner: "A set of small fixes: - Repair the ktime_get_coarse() functions so they actually deliver what they are supposed to: tick granular time stamps. The current code missed to add the accumulated nanoseconds part of the timekeeper so the resulting granularity was 1 second. - Prevent the tracer from infinitely recursing into time getter functions in the arm architectured timer by marking these functions notrace - Fix a trivial compiler warning caused by wrong qualifier ordering" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timekeeping: Repair ktime_get_coarse*() granularity clocksource/drivers/arm_arch_timer: Don't trace count reader functions clocksource/drivers/timer-ti-dm: Change to new style declaration
-rw-r--r--drivers/clocksource/arm_arch_timer.c8
-rw-r--r--drivers/clocksource/timer-ti-dm.c2
-rw-r--r--kernel/time/timekeeping.c5
3 files changed, 8 insertions, 7 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index b2a951a798e2..5c69c9a9a6a4 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -149,22 +149,22 @@ u32 arch_timer_reg_read(int access, enum arch_timer_reg reg,
149 return val; 149 return val;
150} 150}
151 151
152static u64 arch_counter_get_cntpct_stable(void) 152static notrace u64 arch_counter_get_cntpct_stable(void)
153{ 153{
154 return __arch_counter_get_cntpct_stable(); 154 return __arch_counter_get_cntpct_stable();
155} 155}
156 156
157static u64 arch_counter_get_cntpct(void) 157static notrace u64 arch_counter_get_cntpct(void)
158{ 158{
159 return __arch_counter_get_cntpct(); 159 return __arch_counter_get_cntpct();
160} 160}
161 161
162static u64 arch_counter_get_cntvct_stable(void) 162static notrace u64 arch_counter_get_cntvct_stable(void)
163{ 163{
164 return __arch_counter_get_cntvct_stable(); 164 return __arch_counter_get_cntvct_stable();
165} 165}
166 166
167static u64 arch_counter_get_cntvct(void) 167static notrace u64 arch_counter_get_cntvct(void)
168{ 168{
169 return __arch_counter_get_cntvct(); 169 return __arch_counter_get_cntvct();
170} 170}
diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
index e40b55a7086f..5394d9dbdfbc 100644
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -896,7 +896,7 @@ static int omap_dm_timer_remove(struct platform_device *pdev)
896 return ret; 896 return ret;
897} 897}
898 898
899const static struct omap_dm_timer_ops dmtimer_ops = { 899static const struct omap_dm_timer_ops dmtimer_ops = {
900 .request_by_node = omap_dm_timer_request_by_node, 900 .request_by_node = omap_dm_timer_request_by_node,
901 .request_specific = omap_dm_timer_request_specific, 901 .request_specific = omap_dm_timer_request_specific,
902 .request = omap_dm_timer_request, 902 .request = omap_dm_timer_request,
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 85f5912d8f70..44b726bab4bd 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -808,17 +808,18 @@ ktime_t ktime_get_coarse_with_offset(enum tk_offsets offs)
808 struct timekeeper *tk = &tk_core.timekeeper; 808 struct timekeeper *tk = &tk_core.timekeeper;
809 unsigned int seq; 809 unsigned int seq;
810 ktime_t base, *offset = offsets[offs]; 810 ktime_t base, *offset = offsets[offs];
811 u64 nsecs;
811 812
812 WARN_ON(timekeeping_suspended); 813 WARN_ON(timekeeping_suspended);
813 814
814 do { 815 do {
815 seq = read_seqcount_begin(&tk_core.seq); 816 seq = read_seqcount_begin(&tk_core.seq);
816 base = ktime_add(tk->tkr_mono.base, *offset); 817 base = ktime_add(tk->tkr_mono.base, *offset);
818 nsecs = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift;
817 819
818 } while (read_seqcount_retry(&tk_core.seq, seq)); 820 } while (read_seqcount_retry(&tk_core.seq, seq));
819 821
820 return base; 822 return base + nsecs;
821
822} 823}
823EXPORT_SYMBOL_GPL(ktime_get_coarse_with_offset); 824EXPORT_SYMBOL_GPL(ktime_get_coarse_with_offset);
824 825