Re: [patch 06/38] calibrate: Rework delay timer calibration
Jon Hunter <[email protected]>
| Newsgroups | dev.linux.lists.iommu,dev.linux.lists.loongarch,org.infradead.lists.linux-riscv,org.kernel.vger.linux-alpha,org.kernel.vger.linux-crypto,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fbdev,org.kernel.vger.linux-hams,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k,org.kernel.vger.linux-openrisc,org.kernel.vger.linux-parisc,org.kernel.vger.linux-s390,org.kernel.vger.linux-tegra,org.kernel.vger.linux-wireless,org.kernel.vger.netdev,org.kernel.vger.sparclinux,org.kvack.linux-mm,org.ozlabs.lists.linuxppc-dev |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> > Cc: Arnd Bergmann <[email protected]> ... > --- 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