mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] ARM64: clocksource: drop too early error message
@ 2026-09-04 10:13 Ahmad Fatoum
  2026-09-04 10:34 ` Michael Tretter
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-09-04 10:13 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum, Michael Tretter

Constructors are executed directly after relocations were applied.
But only after applying relocations is it safe to run arbitrary C code.

This causes an issue: If arm_arch_timer_init() fails and CONFIG_DEBUG_LL
is enabled, the hardcoded serial port will be used, which may hang the
system if serial setup has not happened yet.

Avoid this issue by skipping the error message.

I have declarative PBL entry point support in the works, which would side
step this issue anyway, so doing anything fancy here right now is not
worth the effort.

Reported-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/lib64/clocksource.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/lib64/clocksource.c b/arch/arm/lib64/clocksource.c
index f992be09b8a7..f5fef1f3d410 100644
--- a/arch/arm/lib64/clocksource.c
+++ b/arch/arm/lib64/clocksource.c
@@ -5,6 +5,5 @@
 
 __attribute__((constructor)) static void init_arch_clock(void)
 {
-	if (arm_arch_timer_init(0))
-		puts_ll("Failed to setup architected timer\n");
+	arm_arch_timer_init(0);
 }
-- 
2.47.3




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

* Re: [PATCH master] ARM64: clocksource: drop too early error message
  2026-09-04 10:13 [PATCH master] ARM64: clocksource: drop too early error message Ahmad Fatoum
@ 2026-09-04 10:34 ` Michael Tretter
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tretter @ 2026-09-04 10:34 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Fri, 04 Sep 2026 12:13:45 +0200, Ahmad Fatoum wrote:
> Constructors are executed directly after relocations were applied.
> But only after applying relocations is it safe to run arbitrary C code.
> 
> This causes an issue: If arm_arch_timer_init() fails and CONFIG_DEBUG_LL
> is enabled, the hardcoded serial port will be used, which may hang the
> system if serial setup has not happened yet.
> 
> Avoid this issue by skipping the error message.
> 
> I have declarative PBL entry point support in the works, which would side
> step this issue anyway, so doing anything fancy here right now is not
> worth the effort.
> 
> Reported-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Tested-by: Michael Tretter <m.tretter@pengutronix.de>

> ---
>  arch/arm/lib64/clocksource.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/lib64/clocksource.c b/arch/arm/lib64/clocksource.c
> index f992be09b8a7..f5fef1f3d410 100644
> --- a/arch/arm/lib64/clocksource.c
> +++ b/arch/arm/lib64/clocksource.c
> @@ -5,6 +5,5 @@
>  
>  __attribute__((constructor)) static void init_arch_clock(void)
>  {
> -	if (arm_arch_timer_init(0))
> -		puts_ll("Failed to setup architected timer\n");
> +	arm_arch_timer_init(0);
>  }
> -- 
> 2.47.3
> 



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

end of thread, other threads:[~2026-09-04 10:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-04 10:13 [PATCH master] ARM64: clocksource: drop too early error message Ahmad Fatoum
2026-09-04 10:34 ` Michael Tretter

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