[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fb6da998-3970-90f9-f79e-386987bfd431@linuxfoundation.org>
Date: Fri, 25 Feb 2022 17:02:43 -0700
From: Shuah Khan <skhan@...uxfoundation.org>
To: Mateusz Jończyk <mat.jonczyk@...pl>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-rtc@...r.kernel.org
Cc: Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Shuah Khan <shuah@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] selftests/rtc: continuously read RTC in a loop for 30s
On 2/25/22 1:56 PM, Shuah Khan wrote:
> On 2/19/22 12:27 AM, Mateusz Jończyk wrote:
>> Some problems with reading the RTC time may happen rarely, for example
>> while the RTC is updating. So read the RTC many times to catch these
>> problems. For example, a previous attempt for my
>> commit ea6fa4961aab ("rtc: mc146818-lib: fix RTC presence check")
>> was incorrect and would have triggered this selftest.
>>
>> To avoid the risk of damaging the hardware, wait 11ms before consecutive
>> reads.
>>
>> In rtc_time_to_timestamp I copied values manually instead of casting -
>> just to be on the safe side. The 11ms wait period was chosen so that it is
>> not a divisor of 1000ms.
>>
>> Signed-off-by: Mateusz Jończyk <mat.jonczyk@...pl>
>> Cc: Alessandro Zummo <a.zummo@...ertech.it>
>> Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>
>> Cc: Shuah Khan <shuah@...nel.org>
>> ---
>>
>> Also, before
>> commit cdedc45c579f ("rtc: cmos: avoid UIP when reading alarm time")
>> reading the RTC alarm time during RTC update produced incorrect results
>> on many Intel platforms. Preparing a similar selftest for this case
>> would be more difficult, though, because the RTC alarm time is cached by
>> the kernel. Direct access would have to be exposed somehow, for example
>> in debugfs. I may prepare a patch for it in the future.
>> ---
>
> Looks good to me. We end up tweaking the timeout=210 in settings every
> now and then. Not sure how we can avoid adjusting it as we find problems.
>
> I will apply this in for Linux 5.18-rc1
>
Applied to linux-kselftest next for Linux 5.18-rc1
thanks,
-- Shuah
Powered by blists - more mailing lists