From: "Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
To: Antheas Kapenekakis <lkml@antheas.dev>
Cc: platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Derek John Clark" <derekjohn.clark@gmail.com>,
"Joaquín Ignacio Aramendía" <samsagax@gmail.com>,
"Jean Delvare" <jdelvare@suse.com>,
"Guenter Roeck" <linux@roeck-us.net>
Subject: Re: [PATCH v2 6/6] platform/x86: ayaneo-ec: Add suspend hook
Date: Tue, 28 Oct 2025 22:36:39 -0500 [thread overview]
Message-ID: <b98a8486-e90a-4bd5-b3a7-3b2ba1b16398@kernel.org> (raw)
In-Reply-To: <CAGwozwFDsn0xm_mG4ypEym=K8c81qqi=qtJL=06nP6SzdFaFoQ@mail.gmail.com>
On 10/28/2025 4:39 PM, Antheas Kapenekakis wrote:
> On Tue, 28 Oct 2025 at 22:21, Mario Limonciello <superm1@kernel.org> wrote:
>>
>> On 10/28/25 3:34 PM, Antheas Kapenekakis wrote:
>>>>> The fan speed is also lost during hibernation, but since hibernation
>>>>> failures are common with this class of devices
>> Why are hibernation failures more common in this class of device than
>> anything else? The hibernation flow is nearly all done in Linux driver
>> code (with the exception of ACPI calls that move devices into D3 and out
>> of D0).
>
> I should correct myself here and say hibernation in general in Linux
> leaves something to be desired.
>
> Until secure boot supports hibernation, that will be the case because
> not enough people use it.
The upstream kernel has no tie between UEFI secure boot and hibernation.
I think you're talking about some distro kernels that tie UEFI secure
boot to lockdown. Lockdown does currently prohibit hibernation.
>
> I have had it break for multiple reasons, not incl. the ones below and
> the ones we discussed last year where games are loaded.
>
> For a few months I fixed some of the bugs but it is not sustainable.
>
>> Perhaps you're seeing a manifestation of a general issue that we're
>> working on a solution for here:
>>
>> https://lore.kernel.org/linux-pm/20251025050812.421905-1-safinaskar@gmail.com/
>>
>> https://lore.kernel.org/linux-pm/20251026033115.436448-1-superm1@kernel.org/
>>
>> https://lore.kernel.org/linux-pm/5935682.DvuYhMxLoT@rafael.j.wysocki/T/#u
>>
>> Or if you're on an older kernel and using hybrid sleep we had a generic
>> issue there as well which was fixed in 6.18-rc1.
>>
>> Nonetheless; don't make policy decisions based upon kernel bugs. Fix
>> the kernel bugs.
>
> My problem is I cannot in good conscience restore a fan speed before
> the program responsible for it is guaranteed to thaw.
>
> The best solution I can come up with would be in freeze save if manual
> control is enabled, disable it, and then on resume set a flag that
> makes the first write to fan speed also set pwm to manual.
>
> This way suspend->hibernate flows, even if hibernation hangs when
> creating the image, at least have proper fan control because they are
> unattended, and resume hangs work similarly.
>
> Antheas
>
This sounds like a workable approach for what I understand to be your
current design; but let me suggest some other ideas.
What happens if you're running something big and the OOM comes and
whacks the process? Now you don't have fan control running anymore.
So I see two options to improve things.
1) You can have userspace send a "heartbeat" to kernel space. This can
be as simple as a timestamp of reading a sysfs file. If userspace
doesn't read the file in X ms then you turn off manual control.
2) You move everything to a kthread. Userspace can read some input
options or maybe pick a few curve settings, but leave all the important
logic in that kthread.
next prev parent reply other threads:[~2025-10-29 3:36 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 8:44 [PATCH v2 0/6] platform/x86: ayaneo-ec: Add Ayaneo Embedded Controller platform driver Antheas Kapenekakis
2025-10-15 8:44 ` [PATCH v2 1/6] " Antheas Kapenekakis
2025-10-15 9:04 ` Ilpo Järvinen
2025-10-26 22:25 ` Armin Wolf
2025-10-15 8:44 ` [PATCH v2 2/6] platform/x86: ayaneo-ec: Add hwmon support Antheas Kapenekakis
2025-10-26 22:33 ` Armin Wolf
2025-10-15 8:44 ` [PATCH v2 3/6] platform/x86: ayaneo-ec: Add charge control support Antheas Kapenekakis
2025-10-26 22:35 ` Armin Wolf
2025-10-15 8:44 ` [PATCH v2 4/6] platform/x86: ayaneo-ec: Add controller power and modules attributes Antheas Kapenekakis
2025-10-15 9:05 ` Ilpo Järvinen
2025-10-15 9:08 ` Ilpo Järvinen
2025-10-26 22:42 ` Armin Wolf
2025-10-15 8:44 ` [PATCH v2 5/6] platform/x86: ayaneo-ec: Move Ayaneo devices from oxpec to ayaneo-ec Antheas Kapenekakis
2025-10-15 9:09 ` Ilpo Järvinen
2025-10-26 22:45 ` Armin Wolf
2025-10-15 8:44 ` [PATCH v2 6/6] platform/x86: ayaneo-ec: Add suspend hook Antheas Kapenekakis
2025-10-15 9:11 ` Ilpo Järvinen
2025-10-15 9:16 ` Antheas Kapenekakis
2025-10-15 9:27 ` Ilpo Järvinen
2025-10-15 9:36 ` Antheas Kapenekakis
2025-10-26 22:49 ` Armin Wolf
2025-10-26 23:17 ` Antheas Kapenekakis
2025-10-28 13:50 ` Armin Wolf
2025-10-28 15:20 ` Antheas Kapenekakis
2025-10-28 15:25 ` Armin Wolf
2025-10-28 17:49 ` Antheas Kapenekakis
2025-10-28 23:14 ` Armin Wolf
2025-10-28 20:26 ` Mario Limonciello
2025-10-28 20:34 ` Antheas Kapenekakis
2025-10-28 21:21 ` Mario Limonciello
2025-10-28 21:39 ` Antheas Kapenekakis
2025-10-29 3:36 ` Mario Limonciello (AMD) (kernel.org) [this message]
2025-10-29 8:48 ` Antheas Kapenekakis
2025-10-29 10:22 ` Guenter Roeck
2025-10-29 10:49 ` Antheas Kapenekakis
2025-10-29 14:25 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b98a8486-e90a-4bd5-b3a7-3b2ba1b16398@kernel.org \
--to=superm1@kernel.org \
--cc=derekjohn.clark@gmail.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lkml@antheas.dev \
--cc=platform-driver-x86@vger.kernel.org \
--cc=samsagax@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox