Skip to content

Commit fb9d62b

Browse files
lukaszluba-armrafaeljw
authored andcommitted
PM: EM: postpone creating the debugfs dir till fs_initcall
The debugfs directory '/sys/kernel/debug/energy_model' is needed before the Energy Model registration can happen. With the recent change in debugfs subsystem it's not allowed to create this directory at early stage (core_initcall). Thus creating this directory would fail. Postpone the creation of the EM debug dir to later stage: fs_initcall. It should be safe since all clients: CPUFreq drivers, Devfreq drivers will be initialized in later stages. The custom debug log below prints the time of creation the EM debug dir at fs_initcall and successful registration of EMs at later stages. [ 1.505717] energy_model: creating rootdir [ 3.698307] cpu cpu0: EM: created perf domain [ 3.709022] cpu cpu1: EM: created perf domain Fixes: 5634856 ("debugfs: do not attempt to create a new file before the filesystem is initalized") Reported-by: Ionela Voinescu <ionela.voinescu@arm.com> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0d02ec6 commit fb9d62b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/power/energy_model.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int __init em_debug_init(void)
9898

9999
return 0;
100100
}
101-
core_initcall(em_debug_init);
101+
fs_initcall(em_debug_init);
102102
#else /* CONFIG_DEBUG_FS */
103103
static void em_debug_create_pd(struct device *dev) {}
104104
static void em_debug_remove_pd(struct device *dev) {}

0 commit comments

Comments
 (0)