diff options
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/tick-broadcast.c | 10 | ||||
-rw-r--r-- | kernel/time/tick-common.c | 6 | ||||
-rw-r--r-- | kernel/time/tick-internal.h | 3 | ||||
-rw-r--r-- | kernel/time/timer_list.c | 4 |
4 files changed, 20 insertions, 3 deletions
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 92ef9a54f0a4..da800ffa810c 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c | |||
@@ -599,4 +599,14 @@ int tick_broadcast_oneshot_active(void) | |||
599 | return tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT; | 599 | return tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT; |
600 | } | 600 | } |
601 | 601 | ||
602 | /* | ||
603 | * Check whether the broadcast device supports oneshot. | ||
604 | */ | ||
605 | bool tick_broadcast_oneshot_available(void) | ||
606 | { | ||
607 | struct clock_event_device *bc = tick_broadcast_device.evtdev; | ||
608 | |||
609 | return bc ? bc->features & CLOCK_EVT_FEAT_ONESHOT : false; | ||
610 | } | ||
611 | |||
602 | #endif | 612 | #endif |
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 0e98fac3d479..119528de8235 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c | |||
@@ -50,7 +50,11 @@ int tick_is_oneshot_available(void) | |||
50 | { | 50 | { |
51 | struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev); | 51 | struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev); |
52 | 52 | ||
53 | return dev && (dev->features & CLOCK_EVT_FEAT_ONESHOT); | 53 | if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT)) |
54 | return 0; | ||
55 | if (!(dev->features & CLOCK_EVT_FEAT_C3STOP)) | ||
56 | return 1; | ||
57 | return tick_broadcast_oneshot_available(); | ||
54 | } | 58 | } |
55 | 59 | ||
56 | /* | 60 | /* |
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index f77b93df0006..1009b06d6f89 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h | |||
@@ -40,6 +40,7 @@ extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup); | |||
40 | extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc); | 40 | extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc); |
41 | extern int tick_broadcast_oneshot_active(void); | 41 | extern int tick_broadcast_oneshot_active(void); |
42 | extern void tick_check_oneshot_broadcast(int cpu); | 42 | extern void tick_check_oneshot_broadcast(int cpu); |
43 | bool tick_broadcast_oneshot_available(void); | ||
43 | # else /* BROADCAST */ | 44 | # else /* BROADCAST */ |
44 | static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) | 45 | static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) |
45 | { | 46 | { |
@@ -50,6 +51,7 @@ static inline void tick_broadcast_switch_to_oneshot(void) { } | |||
50 | static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { } | 51 | static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { } |
51 | static inline int tick_broadcast_oneshot_active(void) { return 0; } | 52 | static inline int tick_broadcast_oneshot_active(void) { return 0; } |
52 | static inline void tick_check_oneshot_broadcast(int cpu) { } | 53 | static inline void tick_check_oneshot_broadcast(int cpu) { } |
54 | static inline bool tick_broadcast_oneshot_available(void) { return true; } | ||
53 | # endif /* !BROADCAST */ | 55 | # endif /* !BROADCAST */ |
54 | 56 | ||
55 | #else /* !ONESHOT */ | 57 | #else /* !ONESHOT */ |
@@ -80,6 +82,7 @@ static inline int tick_resume_broadcast_oneshot(struct clock_event_device *bc) | |||
80 | return 0; | 82 | return 0; |
81 | } | 83 | } |
82 | static inline int tick_broadcast_oneshot_active(void) { return 0; } | 84 | static inline int tick_broadcast_oneshot_active(void) { return 0; } |
85 | static inline bool tick_broadcast_oneshot_available(void) { return false; } | ||
83 | #endif /* !TICK_ONESHOT */ | 86 | #endif /* !TICK_ONESHOT */ |
84 | 87 | ||
85 | /* | 88 | /* |
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index 32a19f9397fc..3258455549f4 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c | |||
@@ -41,7 +41,7 @@ static void print_name_offset(struct seq_file *m, void *sym) | |||
41 | char symname[KSYM_NAME_LEN]; | 41 | char symname[KSYM_NAME_LEN]; |
42 | 42 | ||
43 | if (lookup_symbol_name((unsigned long)sym, symname) < 0) | 43 | if (lookup_symbol_name((unsigned long)sym, symname) < 0) |
44 | SEQ_printf(m, "<%p>", sym); | 44 | SEQ_printf(m, "<%pK>", sym); |
45 | else | 45 | else |
46 | SEQ_printf(m, "%s", symname); | 46 | SEQ_printf(m, "%s", symname); |
47 | } | 47 | } |
@@ -112,7 +112,7 @@ next_one: | |||
112 | static void | 112 | static void |
113 | print_base(struct seq_file *m, struct hrtimer_clock_base *base, u64 now) | 113 | print_base(struct seq_file *m, struct hrtimer_clock_base *base, u64 now) |
114 | { | 114 | { |
115 | SEQ_printf(m, " .base: %p\n", base); | 115 | SEQ_printf(m, " .base: %pK\n", base); |
116 | SEQ_printf(m, " .index: %d\n", | 116 | SEQ_printf(m, " .index: %d\n", |
117 | base->index); | 117 | base->index); |
118 | SEQ_printf(m, " .resolution: %Lu nsecs\n", | 118 | SEQ_printf(m, " .resolution: %Lu nsecs\n", |