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 23CD7376BD3 for ; Thu, 9 Jul 2026 14:42:16 +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=1783608138; cv=none; b=EgWBPSgdEx1zbPZU0LSG2Do4giV3ptQ9Tg1kHss1S7do0SHWmaeL4N0MfB1WbH5zChA8a74d/ikTEr+NS4nwhQgdT4H39o2NNMPOAGLuQoELyN3+vDLX/JcHJLeu4k3W8Jf4qy1uRzL5AQeHPdp1Fn+cyiG7AcCwNop7V6mj0as= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783608138; c=relaxed/simple; bh=zX/tu/6Zz2E+vXI3owFV0a+Dc5YYm/A3bCxiS/yakVU=; h=Message-ID:Date:MIME-Version:Subject:To:From:In-Reply-To: Content-Type:References; b=BP1WXyw0UeugJJ/V/slEWG1VKEOpIoZCewGa+DcQQex4dpGjyZWeCBsO5BWBd0Mfhkw8JCLrFU3yDVZsjiPme1YVvkqiNGIdSjC0Av+rbdDoOuewRwj50JW3XfCgQDk1gPCrFLESdan3m48UfV3z6p/3zsOnAZP6wlbsi8fPQWg= 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=YQoQEAfX; 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="YQoQEAfX" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20260709144214euoutp0249b6d74d22d0f945963455da3702db0d~ApiXxuYKS1534115341euoutp022 for ; Thu, 9 Jul 2026 14:42:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20260709144214euoutp0249b6d74d22d0f945963455da3702db0d~ApiXxuYKS1534115341euoutp022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1783608134; bh=l11kavALr8MkiD/xH9t/47beIt5dlVvJTZn0B+7SbDc=; h=Date:Subject:To:From:In-Reply-To:References:From; b=YQoQEAfXKPfIrPIUG5elWHHdu96Y+hwuRMoxWV4Ek+4vyqZ6Kx/lwhHxomtiibZJC LuV8zTY23aHuJo3V+0KxPiTVaTKDYFIID0S9/q0JRnmwchm7KwOJuz21UmNKILY3WU /HbF296Irk2ZQGL2dY5eia49mW/tZyFUmhGPe0XA= Received: from eusmtip1.samsung.com (unknown [203.254.199.221]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20260709144213eucas1p2e42ada962ff11432810cfeff4b6293b6~ApiXM1kWJ1742717427eucas1p2O; Thu, 9 Jul 2026 14:42:13 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20260709144212eusmtip191dd8a6896abaf2f45d0588deaa449d6~ApiV9ReV-1307413074eusmtip1O; Thu, 9 Jul 2026 14:42:12 +0000 (GMT) Message-ID: Date: Thu, 9 Jul 2026 16:42:11 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Betterbird (Windows) Subject: Re: [PATCH v7 3/7] timekeeping: Account for clocksource tick quantisation via NTP To: David Woodhouse , Richard Cochran , Wen Gu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Stultz , Thomas Gleixner , Stephen Boyd , Anna-Maria Behnsen , Frederic Weisbecker , Shuah Khan , Peter Zijlstra , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Arnd Bergmann , Miroslav Lichvar , Julien Ridoux , Ryan Luu , linux-kernel@vger.kernel.org Content-Language: en-US From: Marek Szyprowski In-Reply-To: Content-Transfer-Encoding: 8bit X-CMS-MailID: 20260709144213eucas1p2e42ada962ff11432810cfeff4b6293b6 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20260709125630eucas1p2d1acb4893a1c72dfba5312453c0971f2 X-EPHeader: CA X-CMS-RootMailID: 20260709125630eucas1p2d1acb4893a1c72dfba5312453c0971f2 References: <20260621220051.1030462-1-dwmw2@infradead.org> <20260621220051.1030462-4-dwmw2@infradead.org> On 09.07.2026 15:38, David Woodhouse wrote: > On Thu, 2026-07-09 at 14:56 +0200, Marek Szyprowski wrote: >> This patch landed yesterday in linux-next as commit e8bf3955dc2f >> ("timekeeping: Account for clocksource tick quantisation via NTP"). >> In my tests I found that it breaks booting Raspberry Pi 3B and Pi 4B >> boards in ARM 32bit mode with quite old (Debian 10) userspace. Booting >> freezes just before getting a getty login prompt and no more kernel >> or userspace messages are observed. If I start with init=/bin/bash in >> kernel cmdline and then wait a while and do "exec /sbin/init" I get >> the following additional kernel message: >> >> [  186.867605] Adjusting arch_sys_counter more than 11% (12136 vs 344864995) >> >> then booting freezes again before getting getty prompt. >> >> I can do some more tests, just let me know what will help debugging this >> issue. Other ARM 32bit machines I have work fine with this patch. >> >> Reverting subject together with its dependencies on top of linux-next  >> fixes the issue. > Thank you. > > I'm confused at this, because it's basically adding the *same* delta to > the tick, just in a different place. > > While I go and frown at the maths a bit more... would you mind testing > if *just* the change from TK_CLOCK_WAS_SET to TK_UPDATE_ALL in > timekeeping_init() is the culprit? > > Could you add some pr_info() of xtime_remainder and cs_tick_adj (in the > before vs. after cases)? I'm not sure if I got it right. Here are the results and diffs I've applied: before: [    0.458729] cs_tick_adj 100000 186a0 diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 9e1cbc590988..1aef9434b5a3 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -369,6 +369,8 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock)         tk->xtime_remainder = ntpinterval - tk->xtime_interval;         tk->raw_interval = interval * clock->mult; +       pr_info("cs_tick_adj %llu %llx\n", (unsigned long long)tk->xtime_remainder, (unsigned long long)tk->xtime_remainder); +         /* if changing clocks, convert xtime_nsec shift units */         if (old_clock) {                 int shift_change = clock->shift - old_clock->shift; after: [ 0.458546] cs_tick_adj 14151718768290390016 c465013da12d6000 [ 0.464393] clocksource: Switched to clocksource arch_sys_counter diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index e9aff9752d55..c93f2e5e72a6 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -414,6 +414,8 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) ((s64)NTP_INTERVAL_LENGTH << NTP_SCALE_SHIFT); tk->cs_tick_adj *= NTP_INTERVAL_FREQ; + pr_info("cs_tick_adj %llu %llx\n", (unsigned long long)tk->cs_tick_adj, (unsigned long long)tk->cs_tick_adj); + /* * The timekeeper keeps its own mult values for the currently * active clocksource. These value will be adjusted via NTP Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland