Thread (33 messages) 33 messages, 7 authors, 2021-01-31

Re: [patch 1/8] rtc: mc146818: Prevent reading garbage - bug

From: Thomas Gleixner <hidden>
Date: 2021-01-26 15:41:47
Also in: lkml

On Tue, Jan 26 2021 at 15:17, Mickaël Salaün wrote:
Thanks for the fix! It boots now with a new message:
rtc_cmos rtc_cmos: not accessible
quoted
 	spin_lock_irqsave(&rtc_lock, flags);
+	/* Ensure that the RTC is accessible. Bit 0-6 must be 0! */
+	if (WARN_ON_ONCE((CMOS_READ(RTC_VALID) & 0x7f) != 0)) {
+		spin_unlock_irqrestore(&rtc_lock, flags);
+		memset(time, 0xff, sizeof(time));
This should be: sizeof(*time)
Of course ....
quoted
+		return 0;
+	}
+
 	/*
 	 * Check whether there is an update in progress during which the
 	 * readout is unspecified. The maximum update time is ~2ms. Poll
Tested-by: Mickaël Salaün <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help