Skip to content

Commit 814daad

Browse files
committed
Merge tag 'timers_urgent_for_v5.11_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Borislav Petkov: "Two more timers-related fixes for v5.11: - Use a freezable workqueue for RTC sync because the sync can happen at any time and trigger suspend assertion checks in the i2c subsystem. - Correct a previous RTC validation change to check only bit 6 in register D because some Intel machines use bits 0-5" * tag 'timers_urgent_for_v5.11_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: ntp: Use freezable workqueue for RTC synchronization rtc: mc146818: Dont test for bit 0-5 in Register D
2 parents e24f9c5 + 24c242e commit 814daad

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

drivers/rtc/rtc-cmos.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,8 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
805805

806806
spin_lock_irq(&rtc_lock);
807807

808-
/* Ensure that the RTC is accessible. Bit 0-6 must be 0! */
809-
if ((CMOS_READ(RTC_VALID) & 0x7f) != 0) {
808+
/* Ensure that the RTC is accessible. Bit 6 must be 0! */
809+
if ((CMOS_READ(RTC_VALID) & 0x40) != 0) {
810810
spin_unlock_irq(&rtc_lock);
811811
dev_warn(dev, "not accessible\n");
812812
retval = -ENXIO;

drivers/rtc/rtc-mc146818-lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ unsigned int mc146818_get_time(struct rtc_time *time)
2121

2222
again:
2323
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)) {
24+
/* Ensure that the RTC is accessible. Bit 6 must be 0! */
25+
if (WARN_ON_ONCE((CMOS_READ(RTC_VALID) & 0x40) != 0)) {
2626
spin_unlock_irqrestore(&rtc_lock, flags);
2727
memset(time, 0xff, sizeof(*time));
2828
return 0;

kernel/time/ntp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ static struct hrtimer sync_hrtimer;
502502

503503
static enum hrtimer_restart sync_timer_callback(struct hrtimer *timer)
504504
{
505-
queue_work(system_power_efficient_wq, &sync_work);
505+
queue_work(system_freezable_power_efficient_wq, &sync_work);
506506

507507
return HRTIMER_NORESTART;
508508
}
@@ -668,7 +668,7 @@ void ntp_notify_cmos_timer(void)
668668
* just a pointless work scheduled.
669669
*/
670670
if (ntp_synced() && !hrtimer_is_queued(&sync_hrtimer))
671-
queue_work(system_power_efficient_wq, &sync_work);
671+
queue_work(system_freezable_power_efficient_wq, &sync_work);
672672
}
673673

674674
static void __init ntp_init_cmos_sync(void)

0 commit comments

Comments
 (0)