* Re: [patch 06/38] calibrate: Rework delay timer calibration
[not found] ` <20260410120317.978403520@kernel.org>
@ 2026-08-20 16:12 ` Jon Hunter
0 siblings, 0 replies; only message in thread
From: Jon Hunter @ 2026-08-20 16:12 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: Arnd Bergmann, x86, Lu Baolu, iommu, Michael Grzeschik, netdev,
linux-wireless, Herbert Xu, linux-crypto, Vlastimil Babka,
linux-mm, David Woodhouse, Bernie Thompson, linux-fbdev,
Theodore Tso, linux-ext4, Andrew Morton, Uladzislau Rezki,
Marco Elver, Dmitry Vyukov, kasan-dev, Andrey Ryabinin,
Thomas Sailer, linux-hams, Jason A. Donenfeld, Richard Henderson,
linux-alpha, Russell King, linux-arm-kernel, Catalin Marinas,
Huacai Chen, loongarch, Geert Uytterhoeven, linux-m68k,
Dinh Nguyen, Jonas Bonn, linux-openrisc, Helge Deller,
linux-parisc, Michael Ellerman, linuxppc-dev, Paul Walmsley,
linux-riscv, Heiko Carstens, linux-s390, David S. Miller,
sparclinux, linux-tegra@vger.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-20 16:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260410120044.031381086@kernel.org>
[not found] ` <20260410120317.978403520@kernel.org>
2026-08-20 16:12 ` [patch 06/38] calibrate: Rework delay timer calibration Jon Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox