PM / wakeup: Register class wakeup in pure_initcall phase
Subsystems (4)
PATCH 1/1 PM / wakeup: Register class wakeup in pure_initcall phase
Wakeup sources (e.g. autosleep) can be created as early as core_initcall. Class wakeup is registered in postcore_initcall only, what results in autosleep wakeup source not being shown in sysfs. To fix this, register class wakeup in pure_initcall phase already.
The current behavior doesn't cause any known issue, therefore treat the change as an improvement.
--- drivers/base/power/wakeup_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/power/wakeup_stats.c +1 -1
@@ -216,4 +216,4 @@ static int __init wakeup_sources_sysfs_init(void)return PTR_ERR_OR_ZERO (wakeup_class); } -postcore_initcall (wakeup_sources_sysfs_init); +pure_initcall (wakeup_sources_sysfs_init);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerQuoted 26 lines · Heiner Kallweit
Wakeup sources (e.g. autosleep) can be created as early as
core_initcall. Class wakeup is registered inpostcore_initcallonly, what results in autosleep wakeup source not being shown in sysfs. To fix this, register class wakeup inpure_initcallphase already.The current behavior doesn't cause any known issue, therefore treat the change as an improvement.
Signed-off-by Heiner Kallweit <[email protected]>--- drivers/base/power/wakeup_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/power/wakeup_stats.c +1
-1@@ -216,4 +216,4 @@ static int __init wakeup_sources_sysfs_init(void)return PTR_ERR_OR_ZERO (wakeup_class); } -postcore_initcall (wakeup_sources_sysfs_init); +pure_initcall (wakeup_sources_sysfs_init);Signature · 1 line
2.53.0
Wait, if this doesn't need to be change, we shouldn't change it. Unless you have a bug that is being fixed here, don't touch init call levels. They are tricky and will come to bite you if you don't watch out.
thanks,
greg k-h
Rafael J. Wysocki
maintainerQuoted 21 lines · Greg Kroah-Hartman
Quoted 19 lines · Heiner Kallweit
Wakeup sources (e.g. autosleep) can be created as early as
core_initcall. Class wakeup is registered inpostcore_initcallonly, what results in autosleep wakeup source not being shown in sysfs. To fix this, register class wakeup inpure_initcallphase already.The current behavior doesn't cause any known issue, therefore treat the change as an improvement.
Signed-off-by Heiner Kallweit <[email protected]>--- drivers/base/power/wakeup_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/power/wakeup_stats.c +0
-0@@ -216,4 +216,4 @@ static int __init wakeup_sources_sysfs_init(void)
Quoted 11 lines
Quoted 7 lines
drivers/base/power/wakeup_stats.c +1
-2return PTR_ERR_OR_ZERO (wakeup_class); } -postcore_initcall (wakeup_sources_sysfs_init); +pure_initcall (wakeup_sources_sysfs_init); --2.53.0
Wait, if this doesn't need to be change, we shouldn't change it. Unless you have a bug that is being fixed here, don't touch init call levels. They are tricky and will come to bite you if you don't watch out.
Well, if this is objectionable, a quite straightforward alternative is to call wakeup_sources_sysfs_init() directly from pm_init() before invoking pm_autosleep_init().
That would also indicate an ordering dependency between the two calls.