PM / s2idle: Export s2idle_set_ops
Subsystems (3)
PATCH 1/1 PM / s2idle: Export s2idle_set_ops
This series based on 5.9-rc1
As suspend_set_ops is exported in commit a5e4fd8783a2 ("PM / Suspend: Export suspend_set_ops, suspend_valid_only_mem"), exporting s2idle_set_ops to make kernel module setup s2idle ops too.
In this way, kernel module can hook platform suspend functions regardless of Suspend-to-Ram(S2R) or Suspend-to-Idle(S2I)
*** BLURB HERE ***
Claude Yen (1):
PM / s2idle: Export s2idle_set_ops
kernel/power/suspend.c | 1 + 1 file changed, 1 insertion(+)
PATCH 1/1 PM / s2idle: Export s2idle_set_ops
As suspend_set_ops is exported in commit a5e4fd8783a2 ("PM / Suspend: Export suspend_set_ops, suspend_valid_only_mem"), exporting s2idle_set_ops to make kernel module setup s2idle ops too.
In this way, kernel module can hook platform suspend functions regardless of Suspend-to-Ram(S2R) or Suspend-to-Idle(S2I)
--- kernel/power/suspend.c | 1 + 1 file changed, 1 insertion(+)
kernel/power/suspend.c +1 -0
@@ -79,6 +79,7 @@ void s2idle_set_ops(const struct platform_s2idle_ops *ops) s2idle_ops = ops;unlock_system_sleep (); } +EXPORT_SYMBOL_GPL (s2idle_set_ops);static void s2idle_begin (void ) {
Signature · 5 lines
2.18.0 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 8 lines · Claude Yen
As
suspend_set_opsis exported in commita5e4fd8783a2("PM / Suspend: Exportsuspend_set_ops,suspend_valid_only_mem"), exportings2idle_set_opsto make kernel module setup s2idle ops too.In this way, kernel module can hook platform suspend functions regardless of Suspend-to-Ram(S2R) or Suspend-to-Idle(S2I)
If this is for arm64 platform, then NACK. You must use PSCI and it will set the ops and it can't be module.
Signature · 2 lines
Regards, Sudeep
Quoted 5 lines · Sudeep Holla
Quoted 4 lines · Claude Yen
As
suspend_set_opsis exported in commita5e4fd8783a2("PM / Suspend: Exportsuspend_set_ops,suspend_valid_only_mem"), exportings2idle_set_opsto make kernel module setup s2idle ops too.
Quoted 8 lines
Quoted 4 lines
In this way, kernel module can hook platform suspend functions regardless of Suspend-to-Ram(S2R) or Suspend-to-Idle(S2I)
If this is for arm64 platform, then NACK. You must use PSCI and it will set the ops and it can't be module.
PSCI uses suspend_set_ops instead. And suspend_set_ops has been exported years ago.
Suspend-to_Idle(S2I) is another suspend method supported by linux kernel. The corresponding s2idle_ops can be hooked by s2idle_set_ops by underlying platforms. For example, S2I is now introduced into Mediatek SoC platforms. Besides, power management driver is built as kernel module.
Mobile platforms are now call for kernel drivers to be kernel modules. This could help drivers easier to migrate to newer linux kernel.
Ref: https://linuxplumbersconf.org/event/7/contributions/790/
Regards,
Claude
Quoted 24 lines · claude yen
Quoted 5 lines · Sudeep Holla
Quoted 4 lines · Claude Yen
As
suspend_set_opsis exported in commita5e4fd8783a2("PM / Suspend: Exportsuspend_set_ops,suspend_valid_only_mem"), exportings2idle_set_opsto make kernel module setup s2idle ops too.Quoted 8 lines
Quoted 4 lines
In this way, kernel module can hook platform suspend functions regardless of Suspend-to-Ram(S2R) or Suspend-to-Idle(S2I)
If this is for arm64 platform, then NACK. You must use PSCI and it will set the ops and it can't be module.
PSCI uses
suspend_set_opsinstead. Andsuspend_set_opshas been exported years ago.Suspend-to_Idle(S2I) is another suspend method supported by linux kernel. The corresponding
s2idle_opscan be hooked bys2idle_set_opsby underlying platforms. For example, S2I is now introduced into Mediatek SoC platforms. Besides, power management driver is built as kernel module.
Quoted 4 lines
Mobile platforms are now call for kernel drivers to be kernel modules. This could help drivers easier to migrate to newer linux kernel.
Ref: https://linuxplumbersconf.org/event/7/contributions/790/
I understand that. But I am interested in looking at the module you want to use this and how that interacts with PSCI. If this is arm64, you must use PSCI for system suspend and cpu suspend. What does this module do on top of those is what I want to know. Please post that module or point me if it is already present in the tree.
Signature · 2 lines
Regards, Sudeep
Rafael J. Wysocki
maintainerQuoted 31 lines · Sudeep Holla
Quoted 24 lines · claude yen
Quoted 5 lines · Sudeep Holla
Quoted 4 lines · Claude Yen
As
suspend_set_opsis exported in commita5e4fd8783a2("PM / Suspend: Exportsuspend_set_ops,suspend_valid_only_mem"), exportings2idle_set_opsto make kernel module setup s2idle ops too.Quoted 8 lines
Quoted 4 lines
In this way, kernel module can hook platform suspend functions regardless of Suspend-to-Ram(S2R) or Suspend-to-Idle(S2I)
If this is for arm64 platform, then NACK. You must use PSCI and it will set the ops and it can't be module.
PSCI uses
suspend_set_opsinstead. Andsuspend_set_opshas been exported years ago.Suspend-to_Idle(S2I) is another suspend method supported by linux kernel. The corresponding
s2idle_opscan be hooked bys2idle_set_opsby underlying platforms. For example, S2I is now introduced into Mediatek SoC platforms. Besides, power management driver is built as kernel module.Quoted 4 lines
Mobile platforms are now call for kernel drivers to be kernel modules. This could help drivers easier to migrate to newer linux kernel.
Ref: https://linuxplumbersconf.org/event/7/contributions/790/
Quoted 5 lines
I understand that. But I am interested in looking at the module you want to use this and how that interacts with PSCI. If this is arm64, you must use PSCI for system suspend and cpu suspend. What does this module do on top of those is what I want to know. Please post that module or point me if it is already present in the tree.
Regardless, generally speaking, patches that export stuff to modules without an in-the-tree user needing this are not applicable to the mainline kernel source tree IMV.
Cheers!
Quoted 38 lines · Rafael J. Wysocki
Quoted 31 lines · Sudeep Holla
Quoted 24 lines · claude yen
Quoted 5 lines · Sudeep Holla
Quoted 4 lines · Claude Yen
As
suspend_set_opsis exported in commita5e4fd8783a2("PM / Suspend: Exportsuspend_set_ops,suspend_valid_only_mem"), exportings2idle_set_opsto make kernel module setup s2idle ops too.Quoted 8 lines
Quoted 4 lines
In this way, kernel module can hook platform suspend functions regardless of Suspend-to-Ram(S2R) or Suspend-to-Idle(S2I)
If this is for arm64 platform, then NACK. You must use PSCI and it will set the ops and it can't be module.
PSCI uses
suspend_set_opsinstead. Andsuspend_set_opshas been exported years ago.Suspend-to_Idle(S2I) is another suspend method supported by linux kernel. The corresponding
s2idle_opscan be hooked bys2idle_set_opsby underlying platforms. For example, S2I is now introduced into Mediatek SoC platforms. Besides, power management driver is built as kernel module.Quoted 4 lines
Mobile platforms are now call for kernel drivers to be kernel modules. This could help drivers easier to migrate to newer linux kernel.
Ref: https://linuxplumbersconf.org/event/7/contributions/790/Quoted 5 lines
I understand that. But I am interested in looking at the module you want to use this and how that interacts with PSCI. If this is arm64, you must use PSCI for system suspend and cpu suspend. What does this module do on top of those is what I want to know. Please post that module or point me if it is already present in the tree.
Quoted 5 lines
Regardless, generally speaking, patches that export stuff to modules without an in-the-tree user needing this are not applicable to the mainline kernel source tree IMV.
Cheers!
Thank for your feedbacks!
Indeed, there is no actual kernel module which uses s2idle_set_ops in Mainline kernel right now.
However, Google recently ask SoC vendors to build drivers as kernel modules for reducing migration efforts. For example, The power management driver on Mediatek platform is now built as vendor module, which has no plan to upstream so far.
From Mainline kernel's perspective, I am wondering whether such vendor modules are applicable to export APIs. Exporting APIs only at Google's Android Common Kernel is an option, but this would make Android Kernel and Mainline kernel much more diverse.
Regards,
Claude
Quoted 8 lines · Claude Yen
This series based on 5.9-rc1
As
suspend_set_opsis exported in commita5e4fd8783a2("PM / Suspend: Exportsuspend_set_ops,suspend_valid_only_mem"), exportings2idle_set_opsto make kernel module setup s2idle ops too.In this way, kernel module can hook platform suspend functions regardless of Suspend-to-Ram(S2R) or Suspend-to-Idle(S2I)
Where is the actual users of the export?
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek