Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'timers-urgent-2021-01-31' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fix from Thomas Gleixner:
"A fix for handling advertised, but non-existent 146818 RTCs correctly.

With the recent UIP handling changes the time readout of non-existent
RTCs hangs forever as the read returns always 0xFF which means the UIP
bit is set.

Sanity check the RTC before registering by checking the RTC_VALID
register for correctness"

* tag 'timers-urgent-2021-01-31' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
rtc: mc146818: Detect and handle broken RTCs

+15
+8
drivers/rtc/rtc-cmos.c
··· 805 805 806 806 spin_lock_irq(&rtc_lock); 807 807 808 + /* Ensure that the RTC is accessible. Bit 0-6 must be 0! */ 809 + if ((CMOS_READ(RTC_VALID) & 0x7f) != 0) { 810 + spin_unlock_irq(&rtc_lock); 811 + dev_warn(dev, "not accessible\n"); 812 + retval = -ENXIO; 813 + goto cleanup1; 814 + } 815 + 808 816 if (!(flags & CMOS_RTC_FLAGS_NOFREQ)) { 809 817 /* force periodic irq to CMOS reset default of 1024Hz; 810 818 *
+7
drivers/rtc/rtc-mc146818-lib.c
··· 21 21 22 22 again: 23 23 spin_lock_irqsave(&rtc_lock, flags); 24 + /* Ensure that the RTC is accessible. Bit 0-6 must be 0! */ 25 + if (WARN_ON_ONCE((CMOS_READ(RTC_VALID) & 0x7f) != 0)) { 26 + spin_unlock_irqrestore(&rtc_lock, flags); 27 + memset(time, 0xff, sizeof(*time)); 28 + return 0; 29 + } 30 + 24 31 /* 25 32 * Check whether there is an update in progress during which the 26 33 * readout is unspecified. The maximum update time is ~2ms. Poll