[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eb5feef3-0a7d-438c-9dbb-00d1d72fad66@samsung.com>
Date: Wed, 9 Jul 2025 10:04:21 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
Thomas Gleixner <tglx@...utronix.de>
Cc: Andy Lutomirski <luto@...nel.org>, Vincenzo Frascino
<vincenzo.frascino@....com>, Shuah Khan <shuah@...nel.org>, Anna-Maria
Behnsen <anna-maria@...utronix.de>, Frederic Weisbecker
<frederic@...nel.org>, John Stultz <jstultz@...gle.com>, Stephen Boyd
<sboyd@...nel.org>, Catalin Marinas <catalin.marinas@....com>, Will Deacon
<will@...nel.org>, Arnd Bergmann <arnd@...db.de>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-arch@...r.kernel.org, Richard
Cochran <richardcochran@...il.com>, Christopher Hall
<christopher.s.hall@...el.com>, Miroslav Lichvar <mlichvar@...hat.com>,
Werner Abt <werner.abt@...nberg-usa.com>, David Woodhouse
<dwmw2@...radead.org>, Kurt Kanzenbach <kurt@...utronix.de>, Nam Cao
<namcao@...utronix.de>, Antoine Tenart <atenart@...nel.org>
Subject: Re: [PATCH 06/14] vdso/gettimeofday: Return bool from
clock_gettime() helpers
On 09.07.2025 09:34, Thomas Weißschuh wrote:
> On Tue, Jul 08, 2025 at 05:49:18PM +0200, Marek Szyprowski wrote:
>> On 08.07.2025 17:17, Marek Szyprowski wrote:
>>> On 01.07.2025 10:58, Thomas Weißschuh wrote:
>>>> The internal helpers are effectively using boolean results,
>>>> while pretending to use error numbers.
>>>>
>>>> Switch the return type to bool for more clarity.
>>>>
>>>> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
>>>> ---
>>>> lib/vdso/gettimeofday.c | 58
>>>> +++++++++++++++++++++++++------------------------
>>>> 1 file changed, 30 insertions(+), 28 deletions(-)
>>> This patch landed in today's linux-next as commit fcc8e46f768f
>>> ("vdso/gettimeofday: Return bool from clock_gettime() helpers"). In my
>>> tests I found that it causes serious problem with hwclock operation on
>>> some of my ARM 32bit test boards. I observe that calling "hwclock -w
>>> -f /dev/rtc0" never ends on those boards. Disabling vdso support (by
>>> removing ARM architected timer) fixes this issue.
>> I spent some time analyzing the code refactored in this patch and it
>> looks that the following change is missing:
> Thanks for the report and investigation!
>
>> diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
>> index c5266532a097..7e79b02839b0 100644
>> --- a/lib/vdso/gettimeofday.c
>> +++ b/lib/vdso/gettimeofday.c
>> @@ -344,7 +344,7 @@ __cvdso_gettimeofday_data(const struct
>> vdso_time_data *vd,
>> if (likely(tv != NULL)) {
>> struct __kernel_timespec ts;
>>
>> - if (do_hres(vd, &vc[CS_HRES_COARSE], CLOCK_REALTIME, &ts))
>> + if (!do_hres(vd, &vc[CS_HRES_COARSE], CLOCK_REALTIME, &ts))
>> return gettimeofday_fallback(tv, tz);
>>
>> tv->tv_sec = ts.tv_sec;
>>
>>
>> In my tests this fixed the hwclock issue on the mentioned boards.
> This fix looks correct to me.
>
>
> tglx:
>
> Are you going to fold the fix into the commit or do you want a proper patch?
>
>
> Marek:
>
> If a new patch is required, do you want to send it? You found and fixed the
> issue after all. If not, I'll take care of it.
If it is possible to fold it into original patch then go ahead, it would
make less noise imho. If you need a formal patch, I can send it in a few
minutes.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Powered by blists - more mailing lists