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 <[email protected]> Signed-off-by: Ahmad Fatoum <[email protected]> --- 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
