提交 cebac534 编写于 作者: L Lukasz Luba 提交者: Zheng Zengkai

PM: EM: postpone creating the debugfs dir till fs_initcall

stable inclusion
from stable-5.10.27
commit 7d019b2d0f270219646c53cbba7c633fec76b5cb
bugzilla: 51493

--------------------------------

[ Upstream commit fb9d62b2 ]

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: 56348560 ("debugfs: do not attempt to create a new file before the filesystem is initalized")
Reported-by: NIonela Voinescu <ionela.voinescu@arm.com>
Signed-off-by: NLukasz Luba <lukasz.luba@arm.com>
Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: N  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 96bb6ad9
......@@ -85,7 +85,7 @@ static int __init em_debug_init(void)
return 0;
}
core_initcall(em_debug_init);
fs_initcall(em_debug_init);
#else /* CONFIG_DEBUG_FS */
static void em_debug_create_pd(struct device *dev) {}
static void em_debug_remove_pd(struct device *dev) {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册