Skip to content

Commit efba92d

Browse files
committed
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
2 parents f763cf8 + e3ff9c3 commit efba92d

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

drivers/clocksource/arm_arch_timer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,22 @@ u32 arch_timer_reg_read(int access, enum arch_timer_reg reg,
149149
return val;
150150
}
151151

152-
static u64 arch_counter_get_cntpct_stable(void)
152+
static notrace u64 arch_counter_get_cntpct_stable(void)
153153
{
154154
return __arch_counter_get_cntpct_stable();
155155
}
156156

157-
static u64 arch_counter_get_cntpct(void)
157+
static notrace u64 arch_counter_get_cntpct(void)
158158
{
159159
return __arch_counter_get_cntpct();
160160
}
161161

162-
static u64 arch_counter_get_cntvct_stable(void)
162+
static notrace u64 arch_counter_get_cntvct_stable(void)
163163
{
164164
return __arch_counter_get_cntvct_stable();
165165
}
166166

167-
static u64 arch_counter_get_cntvct(void)
167+
static notrace u64 arch_counter_get_cntvct(void)
168168
{
169169
return __arch_counter_get_cntvct();
170170
}

drivers/clocksource/timer-ti-dm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ static int omap_dm_timer_remove(struct platform_device *pdev)
896896
return ret;
897897
}
898898

899-
const static struct omap_dm_timer_ops dmtimer_ops = {
899+
static const struct omap_dm_timer_ops dmtimer_ops = {
900900
.request_by_node = omap_dm_timer_request_by_node,
901901
.request_specific = omap_dm_timer_request_specific,
902902
.request = omap_dm_timer_request,

kernel/time/timekeeping.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,17 +808,18 @@ ktime_t ktime_get_coarse_with_offset(enum tk_offsets offs)
808808
struct timekeeper *tk = &tk_core.timekeeper;
809809
unsigned int seq;
810810
ktime_t base, *offset = offsets[offs];
811+
u64 nsecs;
811812

812813
WARN_ON(timekeeping_suspended);
813814

814815
do {
815816
seq = read_seqcount_begin(&tk_core.seq);
816817
base = ktime_add(tk->tkr_mono.base, *offset);
818+
nsecs = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift;
817819

818820
} while (read_seqcount_retry(&tk_core.seq, seq));
819821

820-
return base;
821-
822+
return base + nsecs;
822823
}
823824
EXPORT_SYMBOL_GPL(ktime_get_coarse_with_offset);
824825

0 commit comments

Comments
 (0)