linux/kernel/time
Geert Uytterhoeven 24c242ec7a ntp: Use freezable workqueue for RTC synchronization
The bug fixed by commit e3fab2f3de ("ntp: Fix RTC synchronization on
32-bit platforms") revealed an underlying issue: RTC synchronization may
happen anytime, even while the system is partially suspended.

On systems where the RTC is connected to an I2C bus, the I2C bus controller
may already or still be suspended, triggering a WARNING during suspend or
resume from s2ram:

    WARNING: CPU: 0 PID: 124 at drivers/i2c/i2c-core.h:54 __i2c_transfer+0x634/0x680
    i2c i2c-6: Transfer while suspended
    [...]
    Workqueue: events_power_efficient sync_hw_clock
    [...]
      (__i2c_transfer)
      (i2c_transfer)
      (regmap_i2c_read)
      ...
      (da9063_rtc_set_time)
      (rtc_set_time)
      (sync_hw_clock)
      (process_one_work)

Fix this race condition by using the freezable instead of the normal
power-efficient workqueue.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20210125143039.1051912-1-geert+renesas@glider.be
2021-02-05 18:03:13 +01:00
..
alarmtimer.c
clockevents.c
clocksource.c
hrtimer.c
itimer.c
jiffies.c
Kconfig
Makefile
namespace.c
ntp.c ntp: Use freezable workqueue for RTC synchronization 2021-02-05 18:03:13 +01:00
ntp_internal.h
posix-clock.c
posix-cpu-timers.c
posix-stubs.c
posix-timers.c
posix-timers.h
sched_clock.c
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c
tick-common.c
tick-internal.h
tick-legacy.c
tick-oneshot.c
tick-sched.c
tick-sched.h
time.c
timeconst.bc
timeconv.c
timecounter.c
timekeeping.c
timekeeping.h
timekeeping_debug.c
timekeeping_internal.h
timer.c
timer_list.c
vsyscall.c