From: Jon Hunter <jonathanh@nvidia.com>
To: Thomas Gleixner <tglx@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
x86@kernel.org, Lu Baolu <baolu.lu@linux.intel.com>,
iommu@lists.linux.dev,
Michael Grzeschik <m.grzeschik@pengutronix.de>,
netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
Herbert Xu <herbert@gondor.apana.org.au>,
linux-crypto@vger.kernel.org, Vlastimil Babka <vbabka@kernel.org>,
linux-mm@kvack.org, David Woodhouse <dwmw2@infradead.org>,
Bernie Thompson <bernie@plugable.com>,
linux-fbdev@vger.kernel.org, Theodore Tso <tytso@mit.edu>,
linux-ext4@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Uladzislau Rezki <urezki@gmail.com>,
Marco Elver <elver@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
kasan-dev@googlegroups.com,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Thomas Sailer <t.sailer@alumni.ethz.ch>,
linux-hams@vger.kernel.org,
"Jason A. Donenfeld" <Jason@zx2c4.com>,
Richard Henderson <richard.henderson@linaro.org>,
linux-alpha@vger.kernel.org, Russell King <linux@armlinux.org.uk>,
linux-arm-kernel@lists.infradead.org,
Catalin Marinas <catalin.marinas@arm.com>,
Huacai Chen <chenhuacai@kernel.org>,
loongarch@lists.linux.dev,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-m68k@lists.linux-m68k.org,
Dinh Nguyen <dinguyen@kernel.org>,
Jonas Bonn <jonas@southpole.se>,
linux-openrisc@vger.kernel.org, Helge Deller <deller@gmx.de>,
linux-parisc@vger.kernel.org,
Michael Ellerman <mpe@ellerman.id.au>,
linuxppc-dev@lists.ozlabs.org, Paul Walmsley <pjw@kernel.org>,
linux-riscv@lists.infradead.org,
Heiko Carstens <hca@linux.ibm.com>,
linux-s390@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
sparclinux@vger.kernel.org,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [patch 06/38] calibrate: Rework delay timer calibration
Date: Thu, 20 Aug 2026 17:12:30 +0100 [thread overview]
Message-ID: <c8a8ed26-973a-4fb3-a72a-f595cccaf1bb@nvidia.com> (raw)
In-Reply-To: <20260410120317.978403520@kernel.org>
Hi Thomas,
On 10/04/2026 13:18, Thomas Gleixner wrote:
> The header define in asm/timex,h and the naming of the function to read the
> delay timer are confusing at best.
>
> Convert it to a config switch selected by the archictures, which provide
> the functionality, and rename the function to delay_read_timer(), which
> makes the purpose clear. Move the declaration to linux/delay.h where it
> belongs.
>
> Remove the resulting empty asm/timex.h files as well.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
...
> --- a/arch/arm/include/asm/timex.h
> +++ b/arch/arm/include/asm/timex.h
> @@ -10,7 +10,10 @@
> #define _ASMARM_TIMEX_H
>
> typedef unsigned long cycles_t;
> -#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; })
> +// Temporary workaround
> +bool delay_read_timer(unsigned long *t);
> +
> +#define get_cycles() ({ cycles_t c; delay_read_timer(&c) ? 0 : c; })
> #define random_get_entropy() (((unsigned long)get_cycles()) ?: random_get_entropy_fallback())
I have noticed a boot regression on some of our 32-bit Tegra platforms.
Bisect is pointing to this commit. Making the following change does fix
it, as delay_read_timer() now returns a valid value when true ...
diff --git a/arch/arm/include/asm/timex.h b/arch/arm/include/asm/timex.h
index 94e40c19cfc5..4d31eab9dba2 100644
--- a/arch/arm/include/asm/timex.h
+++ b/arch/arm/include/asm/timex.h
@@ -13,7 +13,7 @@ typedef unsigned long cycles_t;
// Temporary workaround until timex.h is cleaned up
bool delay_read_timer(unsigned long *t);
-#define get_cycles() ({ cycles_t c; delay_read_timer(&c) ? 0 : c; })
+#define get_cycles() ({ cycles_t c; delay_read_timer(&c) ? c : 0; })
#define random_get_entropy() (((unsigned long)get_cycles()) ?:
random_get_entropy_fallback())
Cheers
Jon
--
nvpublic
parent reply other threads:[~2026-08-20 16:12 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20260410120317.978403520@kernel.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c8a8ed26-973a-4fb3-a72a-f595cccaf1bb@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=Jason@zx2c4.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=baolu.lu@linux.intel.com \
--cc=bernie@plugable.com \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=davem@davemloft.net \
--cc=deller@gmx.de \
--cc=dinguyen@kernel.org \
--cc=dvyukov@google.com \
--cc=dwmw2@infradead.org \
--cc=elver@google.com \
--cc=geert@linux-m68k.org \
--cc=hca@linux.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=iommu@lists.linux.dev \
--cc=jonas@southpole.se \
--cc=kasan-dev@googlegroups.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-hams@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mm@kvack.org \
--cc=linux-openrisc@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=loongarch@lists.linux.dev \
--cc=m.grzeschik@pengutronix.de \
--cc=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=pjw@kernel.org \
--cc=richard.henderson@linaro.org \
--cc=ryabinin.a.a@gmail.com \
--cc=sparclinux@vger.kernel.org \
--cc=t.sailer@alumni.ethz.ch \
--cc=tglx@kernel.org \
--cc=tytso@mit.edu \
--cc=urezki@gmail.com \
--cc=vbabka@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox