[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e1e97842-0ad3-4270-b0d1-3cc7150988cd@collabora.com>
Date: Tue, 25 Nov 2025 16:12:54 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: usama.anjum@...labora.com, "Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>, Pavel Machek <pavel@...nel.org>,
Danilo Krummrich <dakr@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Thomas Gleixner <tglx@...utronix.de>, Peter Zijlstra <peterz@...radead.org>,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, linux-input@...r.kernel.org, kernel@...labora.com,
superm1@...nel.org
Subject: Re: [PATCH 2/4] ACPI: button: Cancel hibernation if button is pressed
during hibernation
Hi Greg,
Thank you for the review.
On 11/24/25 10:03 PM, Greg Kroah-Hartman wrote:
> On Fri, Nov 07, 2025 at 11:44:29PM +0500, Muhammad Usama Anjum wrote:
>> acpi_pm_wakeup_event() is called from acpi_button_notify() which is
>> called when power button is pressed. The system is worken up from s2idle
>> in this case by setting hard parameter to pm_wakeup_dev_event().
>>
>> Call acpi_pm_wakeup_event() if power button is pressed and hibernation
>> is in progress. Set the hard parameter such that pm_system_wakeup()
>> gets called which increments pm_abort_suspend counter. The explicit call
>> to acpi_pm_wakeup_event() is necessary as ACPI button device has the
>> wakeup source. Hence call to input_report_key() with input device
>> doesn't call pm_system_wakeup() as it doesn't have wakeup source
>> registered.
>>
>> Hence hibernation would be cancelled as in hibernation path, this counter
>> is checked if it should be aborted.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
>
My thinking is that people don't press power button after triggering
hibernation. They will only press power button if they want to cancel the
hibernation or resume from hibernation a bit later when hibernation completes.
> This could be dangerous, as this is not what happens today, are you sure
> that people aren't just used to pressing the button multiple times until
> the system is hibernated? If so, that would now break with this change
> as it's hard to determine what is going on.
Yes, its possible. Previously the device wouldn't cancel hibernation on power
button press; while now it'll cancel.
So should we put this cancellation under some config option to avoid breaking
the default behavior?
>
> And why does hibernate take so long? Why not fix that up instead?
Hibernation is inherently slow: it must freeze devices, copy and
compress/encrypt memory, then resume storage devices to write the image to
disk.
While I've thought about increasing the speed, I've no concrete ideas yet.
The main problem is that its sequential in nature.
>
> thanks,
>
> greg k-h
--
---
Thanks,
Usama
Powered by blists - more mailing lists