-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arch: call arch_smp_init() directly, do not use SYS_INIT #73908
Conversation
46400f6
to
0ee8343
Compare
@@ -661,6 +661,9 @@ FUNC_NORETURN void z_cstart(void) | |||
/* perform basic hardware initialization */ | |||
z_sys_init_run_level(INIT_LEVEL_PRE_KERNEL_1); | |||
z_sys_init_run_level(INIT_LEVEL_PRE_KERNEL_2); | |||
#if defined(CONFIG_SMP) | |||
arch_smp_init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for calling it in other place (earlier)? We call INIT_LEVEL_SMP here:
Line 451 in 593dfe1
z_sys_init_run_level(INIT_LEVEL_SMP); |
This breaks SMP on ARC as we need to call ARC arch_smp_init after we initialize secondary CPU cores (after z_smp_init is called)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then maybe we want to move this into soc/arch layers and out of arch_interface.h entirely? Really there's zero kernel involvement to the function, it's purely there so the platform layers can do their setup, but when/how isn't really something the OS can (or wants to) decide on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now on arc, arch_smp_init
is called in PRE_KERNEL_1., so I am not following.
INIT_LEVEL_SMP has been something we wanted to get rid of, if I am not mistaken, we just have 1-2 users of that level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SMP level and actually initializing smp is indeed completely different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this is sort of a cargo-cult thing; not sure where the pattern came from originally.
@evgeniy-paltsev can you please take another look? |
Ok, initially I was thinking about
as it's only However, I've tested this on ARC SMP platforms - and I've got lot's of test failures (~120 failed test per platform). I need to investigate this. |
can you try moving:
to be between PRE_KERNEL_1 and PRE_KERNEL_2? I think it is related to the timer initialization. |
No need for a DNM, it is already blocked by your review. |
0ee8343
to
9c70f4b
Compare
06d2e79
9c70f4b
to
06d2e79
Compare
Move this to a call in the init process. arch_* calls are no services and should be called consistently during initialization. Place it between PRE_KERNEL_1 and PRE_KERNEL_2 as some drivers initialized in PRE_KERNEL_2 might depend on SMP being setup. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
06d2e79
to
fa25184
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it works.
In the previous implementation there was a conflict of initialization between arch_smp_init and a timer driver for ARC.
Move this to a call in the init process. arch_* calls are no services
and should be called consistently during initialization.
Signed-off-by: Anas Nashif anas.nashif@intel.com