mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] clocksource: omit seeding of RNG in PBL
@ 2025-04-24  8:48 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2025-04-24  8:48 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We do not maintain a PRNG in the PBL, so we should omit the call to
srand_xor in PBL, otherwise it expands to BUG() and breaks the newly
introduced PBL clocksource support.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/clock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/clock.c b/common/clock.c
index 517116e3b9a3..50941fb00822 100644
--- a/common/clock.c
+++ b/common/clock.c
@@ -228,7 +228,8 @@ int init_clock(struct clocksource *cs)
 	cs->cycle_last = cs->read() & cs->mask;
 	current_clock = cs;
 
-	srand_xor(cs->cycle_last);
+	if (IN_PROPER)
+		srand_xor(cs->cycle_last);
 
 	return 0;
 }
-- 
2.39.5




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-24  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-24  8:48 [PATCH] clocksource: omit seeding of RNG in PBL Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox