mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
ARM: Fix get_cycles() after delay_read_timer() conversion
After commitdfc256dac5("calibrate: Rework delay timer calibration"), certain ARM configurations (such as multi_v5_defconfig) hang during boot. The use of read_current_timer() in arch/arm's get_cycles() was improperly converted to delay_read_timer(), resulting in get_cycles() returning 0 even when the timer has been read or an uninitialized stack value when delay_read_timer() returns false. Flip the branches of the ternary condition to fix get_cycles(). Fixes:dfc256dac5("calibrate: Rework delay timer calibration") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com> Cc: Thomas Gleixner <tglx@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Link: https://patch.msgid.link/20260819-fix-arm-get_cycles-v1-1-208bf07ac540@kernel.org
This commit is contained in:
parent
59e6295fac
commit
e1e3a0ab69
|
|
@ -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())
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user