Re: [PATCH] [RFC] kernel/reboot: Add orderly_suspend() via /sbin/suspend user mode helper
From: Cristian Marussi
Date: Tue Nov 17 2026 - 11:46:55 EST
On Tue, Nov 17, 2026 at 09:44:19AM +0100, Marek Vasut wrote:
> Currently, Linux responds to firmware-issued poweroff and reboot requests
> by invoking user mode helpers /sbin/poweroff and /sbin/reboot, which give
> userspace the ability to perform orderly poweroff and reboot according to
> policy set by userspace.
Hi Marek,
>
> This is not the case for firmware-issued suspend request, which directly
> invokes pm_suspend(PM_SUSPEND_MEM), without giving userspace any way to
> determine the suspend policy. This is problematic, because the userspace
> might not be quite ready to suspend right the instant when the suspend
> request from firmware arrives, e.g. because the user is interacting with
> the device and the userspace knows that interaction will end in the near
> future, at which point the system can be suspended perfectly well.
>
> Introduce a user mode helper, /sbin/suspend, which acts the same way as
> the other user mode helpers, and which is invoked when firmware-issued
> suspend request arrives. Userspace can use the helper to apply suspend
> policy, most likely by invoking init system suspend target. In case the
> helper is not present, retain current behavior and suspend immediately.
>
> Note that /sbin/suspend is non-standard. I also considered registering
> an input device and sending KEY_SUSPEND via such a device, but that does
> not seems nice. I also had a look at wake locks, but I don't think this
> is the right tool either. I am sending this as an RFC, because I would
> like to get input on this. I am including change for two platforms, SCMI
> and ZynqMP, which could benefit from this. Thank you for your input !
>
I'll let happily someone decide if this it is worth merging upstream
or not :P....but I would just say that this indeed felt exactly like the
missing bit in the shutdown/reboot kernel framework when I added the
basic reboot/shutdown functionalities to the SCMI Power Control.
If it is really needed to touch base with PID 1 before going suspending
I dont know, but at least this opens the opprtunity for a driver to
choose if userspace has to be involved or not like it is for reboot.
Thanks,
Cristian