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 small set of fixes for time(r) related issues:

- Fix a long standing conversion issue in jiffies_to_msecs() for odd
HZ values like 1024 or 1200 which resulted in returning 0 for small
jiffies values due to rounding down.

- Use the proper CONFIG symbol in the new Y2038 safe compat code for
posix-timers. Not yet a visible breakage, but this will immediately
trigger when the architecture support for the new interfaces is
merged.

- Return an error code in the STM32 clocksource driver on failure
instead of success.

- Remove the redundant and stale irq disabled check in the posix cpu
timer code. The check is at the wrong place anyway and lockdep
already covers it via the sighand lock locking coverage"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
time: Make sure jiffies_to_msecs() preserves non-zero time periods
posix-timers: Fix nanosleep_copyout() for CONFIG_COMPAT_32BIT_TIME
clocksource/drivers/stm32: Fix error return code
posix-cpu-timers: Remove lockdep_assert_irqs_disabled()

+8 -6
+3 -1
drivers/clocksource/timer-stm32.c
··· 304 305 to->private_data = kzalloc(sizeof(struct stm32_timer_private), 306 GFP_KERNEL); 307 - if (!to->private_data) 308 goto deinit; 309 310 rstc = of_reset_control_get(node, NULL); 311 if (!IS_ERR(rstc)) {
··· 304 305 to->private_data = kzalloc(sizeof(struct stm32_timer_private), 306 GFP_KERNEL); 307 + if (!to->private_data) { 308 + ret = -ENOMEM; 309 goto deinit; 310 + } 311 312 rstc = of_reset_control_get(node, NULL); 313 if (!IS_ERR(rstc)) {
+1 -1
kernel/time/hrtimer.c
··· 1659 int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) 1660 { 1661 switch(restart->nanosleep.type) { 1662 - #ifdef CONFIG_COMPAT 1663 case TT_COMPAT: 1664 if (compat_put_timespec64(ts, restart->nanosleep.compat_rmtp)) 1665 return -EFAULT;
··· 1659 int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) 1660 { 1661 switch(restart->nanosleep.type) { 1662 + #ifdef CONFIG_COMPAT_32BIT_TIME 1663 case TT_COMPAT: 1664 if (compat_put_timespec64(ts, restart->nanosleep.compat_rmtp)) 1665 return -EFAULT;
-2
kernel/time/posix-cpu-timers.c
··· 604 /* 605 * Disarm any old timer after extracting its expiry time. 606 */ 607 - lockdep_assert_irqs_disabled(); 608 609 ret = 0; 610 old_incr = timer->it.cpu.incr; ··· 1048 /* 1049 * Now re-arm for the new expiry time. 1050 */ 1051 - lockdep_assert_irqs_disabled(); 1052 arm_timer(timer); 1053 unlock: 1054 unlock_task_sighand(p, &flags);
··· 604 /* 605 * Disarm any old timer after extracting its expiry time. 606 */ 607 608 ret = 0; 609 old_incr = timer->it.cpu.incr; ··· 1049 /* 1050 * Now re-arm for the new expiry time. 1051 */ 1052 arm_timer(timer); 1053 unlock: 1054 unlock_task_sighand(p, &flags);
+4 -2
kernel/time/time.c
··· 28 */ 29 30 #include <linux/export.h> 31 #include <linux/timex.h> 32 #include <linux/capability.h> 33 #include <linux/timekeeper_internal.h> ··· 315 return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC); 316 #else 317 # if BITS_PER_LONG == 32 318 - return (HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32; 319 # else 320 - return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN; 321 # endif 322 #endif 323 }
··· 28 */ 29 30 #include <linux/export.h> 31 + #include <linux/kernel.h> 32 #include <linux/timex.h> 33 #include <linux/capability.h> 34 #include <linux/timekeeper_internal.h> ··· 314 return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC); 315 #else 316 # if BITS_PER_LONG == 32 317 + return (HZ_TO_MSEC_MUL32 * j + (1ULL << HZ_TO_MSEC_SHR32) - 1) >> 318 + HZ_TO_MSEC_SHR32; 319 # else 320 + return DIV_ROUND_UP(j * HZ_TO_MSEC_NUM, HZ_TO_MSEC_DEN); 321 # endif 322 #endif 323 }