From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EF0F22DFB6 for ; Wed, 9 Jul 2025 08:04:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752048267; cv=none; b=Z07KJG8BhVu71buFOg8EaoXHDkuuGfP6tm03yslEJJlYo/qxYR+PQvEo9yX/ELGAdeNympatbjkhHhF3Mjyh3ZeLjRfgRwrkBMW6vZ/baVhgYdqm+ycun2NXHmhCOQBdIi0NqhAkIWC8KLy+SXp0PPgtqE2UtehLAEuQznrOwsY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752048267; c=relaxed/simple; bh=x9wghamldx0u2j9gj7AiFtcSvp3lW0Ag37ypArC2Ehw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=o+90KwwUJLDcnRkUtjMN7LHzLcNkkMNNqUion5cfR0P90b2B2OK49+pmflINbX7T07bOqBhbDK/L5gVDD/06mRGmy4bFUnnVoQBzBJoNt8MZ/LBnV66Ih3z78dXTxAoyAigL8F7gvFLrY9nNoT/BrqNNtK4PZXxPSbEyZeJ3RoM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=BejsIL3E; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="BejsIL3E" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20250709080423euoutp0296d8286968674f91d16ed12727ac2044~Qhpz_jkAc2343223432euoutp021 for ; Wed, 9 Jul 2025 08:04:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20250709080423euoutp0296d8286968674f91d16ed12727ac2044~Qhpz_jkAc2343223432euoutp021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1752048263; bh=XPbLR1Y/RGDLT3IFIFuCqTuW/2Jy/AlFcSJHBKSvw54=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=BejsIL3EWsf1nvFXXKXEDc28c+jKSqRqzVnXTP9ucKRVOC83T+YG3NJGwW6f0y31H sEOQ1TrvM/NSYn1JeF4uK/DDivm8Uh6yUFPp+lWJCgQfNsrmCLeCdcy6r4ceDlSxeQ p7/W5+y4zTJr/nqLxzDGNlvV+N5HtKeTajdw1Ng8= Received: from eusmtip1.samsung.com (unknown [203.254.199.221]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20250709080423eucas1p2cda340188c287620d72277f9f667ccb5~QhpzPtyr50478804788eucas1p2O; Wed, 9 Jul 2025 08:04:23 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250709080421eusmtip10fa864a7ea9517a2b891420091998289~QhpyFWvlX2552125521eusmtip1E; Wed, 9 Jul 2025 08:04:21 +0000 (GMT) Message-ID: Date: Wed, 9 Jul 2025 10:04:21 +0200 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 06/14] vdso/gettimeofday: Return bool from clock_gettime() helpers To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Thomas Gleixner Cc: Andy Lutomirski , Vincenzo Frascino , Shuah Khan , Anna-Maria Behnsen , Frederic Weisbecker , John Stultz , Stephen Boyd , Catalin Marinas , Will Deacon , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Richard Cochran , Christopher Hall , Miroslav Lichvar , Werner Abt , David Woodhouse , Kurt Kanzenbach , Nam Cao , Antoine Tenart Content-Language: en-US From: Marek Szyprowski In-Reply-To: <20250709092958-37148883-ed89-40fe-8cd5-ded5dd60957e@linutronix.de> Content-Transfer-Encoding: 8bit X-CMS-MailID: 20250709080423eucas1p2cda340188c287620d72277f9f667ccb5 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20250708154921eucas1p1fd8fa4374610a991ca5c67bd612ca0c2 X-EPHeader: CA X-CMS-RootMailID: 20250708154921eucas1p1fd8fa4374610a991ca5c67bd612ca0c2 References: <20250701-vdso-auxclock-v1-0-df7d9f87b9b8@linutronix.de> <20250701-vdso-auxclock-v1-6-df7d9f87b9b8@linutronix.de> <02bcd954-5323-4663-a766-f53c67c5a18f@samsung.com> <20250709092958-37148883-ed89-40fe-8cd5-ded5dd60957e@linutronix.de> 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 >>>> --- >>>>   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