linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / EM: postpone creating the debugfs dir till fs_initcall
@ 2021-03-23 14:56 Lukasz Luba
  2021-03-23 15:26 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Lukasz Luba @ 2021-03-23 14:56 UTC (permalink / raw)
  To: linux-kernel, linux-pm, rjw, rafael
  Cc: ionela.voinescu, Dietmar.Eggemann, lukasz.luba, gregkh

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: 56348560d495 ("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>
---
Hi Rafael,

Please take this patch into your PM v5.12 fixes. The change described in
the patch above landed in v5.12-rc1. Some of our EAS/EM tests are failing.

Regards,
Lukasz

 kernel/power/energy_model.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index 1358fa4abfa8..0f4530b3a8cd 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -98,7 +98,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) {}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] PM / EM: postpone creating the debugfs dir till fs_initcall
  2021-03-23 14:56 [PATCH] PM / EM: postpone creating the debugfs dir till fs_initcall Lukasz Luba
@ 2021-03-23 15:26 ` Greg KH
  2021-03-23 15:57   ` Lukasz Luba
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2021-03-23 15:26 UTC (permalink / raw)
  To: Lukasz Luba
  Cc: linux-kernel, linux-pm, rjw, rafael, ionela.voinescu, Dietmar.Eggemann

On Tue, Mar 23, 2021 at 02:56:08PM +0000, Lukasz Luba wrote:
> 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: 56348560d495 ("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>
> ---
> Hi Rafael,
> 
> Please take this patch into your PM v5.12 fixes. The change described in
> the patch above landed in v5.12-rc1. Some of our EAS/EM tests are failing.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PM / EM: postpone creating the debugfs dir till fs_initcall
  2021-03-23 15:26 ` Greg KH
@ 2021-03-23 15:57   ` Lukasz Luba
  2021-03-23 18:55     ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Lukasz Luba @ 2021-03-23 15:57 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, linux-pm, rjw, rafael, ionela.voinescu, Dietmar.Eggemann



On 3/23/21 3:26 PM, Greg KH wrote:
> On Tue, Mar 23, 2021 at 02:56:08PM +0000, Lukasz Luba wrote:
>> 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: 56348560d495 ("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>
>> ---
>> Hi Rafael,
>>
>> Please take this patch into your PM v5.12 fixes. The change described in
>> the patch above landed in v5.12-rc1. Some of our EAS/EM tests are failing.
> 
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 

Thank you Greg!

Regards,
Lukasz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PM / EM: postpone creating the debugfs dir till fs_initcall
  2021-03-23 15:57   ` Lukasz Luba
@ 2021-03-23 18:55     ` Rafael J. Wysocki
  2021-03-24  9:39       ` Lukasz Luba
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2021-03-23 18:55 UTC (permalink / raw)
  To: Lukasz Luba
  Cc: Greg KH, Linux Kernel Mailing List, Linux PM, Rafael J. Wysocki,
	Rafael J. Wysocki, Ionela Voinescu, Dietmar Eggemann

On Tue, Mar 23, 2021 at 4:57 PM Lukasz Luba <lukasz.luba@arm.com> wrote:
>
>
>
> On 3/23/21 3:26 PM, Greg KH wrote:
> > On Tue, Mar 23, 2021 at 02:56:08PM +0000, Lukasz Luba wrote:
> >> 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: 56348560d495 ("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>
> >> ---
> >> Hi Rafael,
> >>
> >> Please take this patch into your PM v5.12 fixes. The change described in
> >> the patch above landed in v5.12-rc1. Some of our EAS/EM tests are failing.
> >
> > Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
>
> Thank you Greg!

Applied as 5.12-rc material, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PM / EM: postpone creating the debugfs dir till fs_initcall
  2021-03-23 18:55     ` Rafael J. Wysocki
@ 2021-03-24  9:39       ` Lukasz Luba
  0 siblings, 0 replies; 5+ messages in thread
From: Lukasz Luba @ 2021-03-24  9:39 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Greg KH, Linux Kernel Mailing List, Linux PM, Rafael J. Wysocki,
	Ionela Voinescu, Dietmar Eggemann



On 3/23/21 6:55 PM, Rafael J. Wysocki wrote:
> On Tue, Mar 23, 2021 at 4:57 PM Lukasz Luba <lukasz.luba@arm.com> wrote:
>>
>>
>>
>> On 3/23/21 3:26 PM, Greg KH wrote:
>>> On Tue, Mar 23, 2021 at 02:56:08PM +0000, Lukasz Luba wrote:
>>>> 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: 56348560d495 ("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>
>>>> ---
>>>> Hi Rafael,
>>>>
>>>> Please take this patch into your PM v5.12 fixes. The change described in
>>>> the patch above landed in v5.12-rc1. Some of our EAS/EM tests are failing.
>>>
>>> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>
>>
>> Thank you Greg!
> 
> Applied as 5.12-rc material, thanks!
> 

Thank you Rafael!

Regards,
Lukasz

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-24  9:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 14:56 [PATCH] PM / EM: postpone creating the debugfs dir till fs_initcall Lukasz Luba
2021-03-23 15:26 ` Greg KH
2021-03-23 15:57   ` Lukasz Luba
2021-03-23 18:55     ` Rafael J. Wysocki
2021-03-24  9:39       ` Lukasz Luba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).