Skip to content

Commit 5bfa0e4

Browse files
James MorseIngo Molnar
authored andcommitted
x86/cpu/intel_epb: Don't rely on link order
intel_epb_init() is called as a subsys_initcall() to register cpuhp callbacks. The callbacks make use of get_cpu_device() which will return NULL unless register_cpu() has been called. register_cpu() is called from topology_init(), which is also a subsys_initcall(). This is fragile. Moving the register_cpu() to a different subsys_initcall() leads to a NULL dereference during boot. Make intel_epb_init() a late_initcall(), user-space can't provide a policy before this point anyway. Signed-off-by: James Morse <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]>
1 parent 04c3024 commit 5bfa0e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/intel_epb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,4 @@ static __init int intel_epb_init(void)
237237
cpuhp_remove_state(CPUHP_AP_X86_INTEL_EPB_ONLINE);
238238
return ret;
239239
}
240-
subsys_initcall(intel_epb_init);
240+
late_initcall(intel_epb_init);

0 commit comments

Comments
 (0)