[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-rtc
Subject: Re: [patch 1/8] rtc: mc146818: Prevent reading garbage - bug
From: Thomas Gleixner <tglx () linutronix ! de>
Date: 2021-01-26 15:35:18
Message-ID: 87y2gfg18p.fsf () nanos ! tec ! linutronix ! de
[Download RAW message or body]
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
>> 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 ....
>> + 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 <mic@linux.microsoft.com>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic