linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/4] PM: Hibernate: Add hibernation cancellation support
@ 2025-10-18 14:21 Muhammad Usama Anjum
  2025-10-18 14:21 ` [RFC 1/4] PM: hibernate: export hibernation_in_progress() Muhammad Usama Anjum
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Muhammad Usama Anjum @ 2025-10-18 14:21 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Dmitry Torokhov, Thomas Gleixner,
	Peter Zijlstra, linux-acpi, linux-kernel, linux-pm, linux-input
  Cc: Muhammad Usama Anjum, kernel, superm1

On a normal laptop/PC, the hibernation takes 15-20 seconds which is
considerable time. Once hibernation is triggered from command line or by
some GUI option, the hibernation cannot be cancelled until completed.
Its not a blocker, but poor user experience.

When power button is pressed during hibernation, it generates interrupt
and then the event is routed to userspace. If systemd is being used, the
logind handles these events and performs the specific action.

During hibernation, the first stage is to freeze the userspace. Hence
even if the power button is pressed, it doesn't aborts the hibernation
as user space daemon is frozen.

My device takes ~19 seconds to hibernate. When I was testing hibernation
using rtcwake with timeout of 10 seconds, I found out that hibernation
gets canceled around 10 seconds mark when the interrupt fires.

In this series, the idea is to find a way to cancel the hibernation.
With this series applied, the hibernation gets cancelled gracefully.

Muhammad Usama Anjum (4):
  PM: hibernate: export hibernation_in_progress()
  ACPI: button: Cancel hibernation if button is pressed during
    hibernation
  Input: Ignore the KEY_POWER events if hibernation is in progress
  PM: sleep: clear pm_abort_suspend at suspend

 drivers/acpi/button.c     | 12 +++++++++---
 drivers/base/power/main.c |  2 ++
 drivers/input/input.c     |  6 ++++++
 include/linux/suspend.h   |  2 ++
 kernel/cpu.c              |  1 +
 kernel/power/hibernate.c  |  6 +++++-
 kernel/power/process.c    |  1 +
 7 files changed, 26 insertions(+), 4 deletions(-)

-- 
2.47.3


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

end of thread, other threads:[~2025-10-22 16:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-18 14:21 [RFC 0/4] PM: Hibernate: Add hibernation cancellation support Muhammad Usama Anjum
2025-10-18 14:21 ` [RFC 1/4] PM: hibernate: export hibernation_in_progress() Muhammad Usama Anjum
2025-10-21 21:07   ` Mario Limonciello (AMD) (kernel.org)
2025-10-22  9:53     ` Rafael J. Wysocki
2025-10-22 16:27       ` Muhammad Usama Anjum
2025-10-18 14:21 ` [RFC 2/4] ACPI: button: Cancel hibernation if button is pressed during hibernation Muhammad Usama Anjum
2025-10-21 21:12   ` Mario Limonciello (AMD) (kernel.org)
2025-10-18 14:21 ` [RFC 3/4] Input: Ignore the KEY_POWER events if hibernation is in progress Muhammad Usama Anjum
2025-10-21 21:14   ` Mario Limonciello (AMD) (kernel.org)
2025-10-22 16:33     ` Muhammad Usama Anjum
2025-10-22 16:40       ` Mario Limonciello
2025-10-18 14:21 ` [RFC 4/4] PM: sleep: clear pm_abort_suspend at suspend Muhammad Usama Anjum

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).