Skip to content

Commit

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

Pull timer fixes from Thomas Gleixner:
 "A small set of timer fixes:

   - Evaluate the -ETIME condition correctly in the imx tpm driver

   - Fix the evaluation order of a condition in posix cpu timers

   - Use pr_cont() in the clockevents code to prevent ugly message
     splitting

   - Remove __current_kernel_time() which is now unused to prevent that
     new users show up.

   - Remove a stale forward declaration"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource/imx-tpm: Correct -ETIME return condition check
  posix-cpu-timers: Ensure set_process_cpu_timer is always evaluated
  timekeeping: Remove __current_kernel_time()
  timers: Remove stale struct tvec_base forward declaration
  clockevents: Fix kernel messages split across multiple lines
  • Loading branch information
Linus Torvalds committed Apr 22, 2018
2 parents 38f0b33 + 7407188 commit c1e9dae
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion drivers/clocksource/timer-imx-tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static int tpm_set_next_event(unsigned long delta,
* of writing CNT registers which may cause the min_delta event got
* missed, so we need add a ETIME check here in case it happened.
*/
return (int)((next - now) <= 0) ? -ETIME : 0;
return (int)(next - now) <= 0 ? -ETIME : 0;
}

static int tpm_set_state_oneshot(struct clock_event_device *evt)
Expand Down
3 changes: 0 additions & 3 deletions include/linux/timekeeping32.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
extern void do_gettimeofday(struct timeval *tv);
unsigned long get_seconds(void);

/* does not take xtime_lock */
struct timespec __current_kernel_time(void);

static inline struct timespec current_kernel_time(void)
{
struct timespec64 now = current_kernel_time64();
Expand Down
2 changes: 0 additions & 2 deletions include/linux/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <linux/debugobjects.h>
#include <linux/stringify.h>

struct tvec_base;

struct timer_list {
/*
* All fields that change during normal runtime grouped to the
Expand Down
4 changes: 3 additions & 1 deletion kernel/time/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,10 +1205,12 @@ void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx,
u64 *newval, u64 *oldval)
{
u64 now;
int ret;

WARN_ON_ONCE(clock_idx == CPUCLOCK_SCHED);
ret = cpu_timer_sample_group(clock_idx, tsk, &now);

if (oldval && cpu_timer_sample_group(clock_idx, tsk, &now) != -EINVAL) {
if (oldval && ret != -EINVAL) {
/*
* We are setting itimer. The *oldval is absolute and we update
* it to be relative, *newval argument is relative and we update
Expand Down
11 changes: 5 additions & 6 deletions kernel/time/tick-oneshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,15 @@ int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *))
if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT) ||
!tick_device_is_functional(dev)) {

printk(KERN_INFO "Clockevents: "
"could not switch to one-shot mode:");
pr_info("Clockevents: could not switch to one-shot mode:");
if (!dev) {
printk(" no tick device\n");
pr_cont(" no tick device\n");
} else {
if (!tick_device_is_functional(dev))
printk(" %s is not functional.\n", dev->name);
pr_cont(" %s is not functional.\n", dev->name);
else
printk(" %s does not support one-shot mode.\n",
dev->name);
pr_cont(" %s does not support one-shot mode.\n",
dev->name);
}
return -EINVAL;
}
Expand Down
7 changes: 0 additions & 7 deletions kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -2139,13 +2139,6 @@ unsigned long get_seconds(void)
}
EXPORT_SYMBOL(get_seconds);

struct timespec __current_kernel_time(void)
{
struct timekeeper *tk = &tk_core.timekeeper;

return timespec64_to_timespec(tk_xtime(tk));
}

struct timespec64 current_kernel_time64(void)
{
struct timekeeper *tk = &tk_core.timekeeper;
Expand Down

0 comments on commit c1e9dae

Please sign in to comment.