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
  2025-04-25  5:39 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* Re: [PATCH] clocksource: omit seeding of RNG in PBL
  2025-04-24  8:48 [PATCH] clocksource: omit seeding of RNG in PBL Ahmad Fatoum
@ 2025-04-25  5:39 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-04-25  5:39 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Thu, 24 Apr 2025 10:48:33 +0200, Ahmad Fatoum wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] clocksource: omit seeding of RNG in PBL
      https://git.pengutronix.de/cgit/barebox/commit/?id=a6e031cc425d (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-25  5:39 UTC | newest]

Thread overview: 2+ messages (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
2025-04-25  5:39 ` Sascha Hauer

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