public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: Antheas Kapenekakis <lkml@antheas.dev>, dmitry.osipenko@collabora.com
Cc: bob.beckett@collabora.com, bookeldor@gmail.com,
	hadess@hadess.net, jaap@haitsma.org, kernel@collabora.com,
	lennart@poettering.net, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, mccann@jhu.edu, rafael@kernel.org,
	richard@hughsie.com, sebastian.reichel@collabora.com,
	systemd-devel@lists.freedesktop.org, xaver.hugl@gmail.com
Subject: Re: [RFC v2 03/10] acpi/x86: s2idle: Add support for adding a delay after begin MS calls
Date: Mon, 27 Apr 2026 20:57:51 -0500	[thread overview]
Message-ID: <3841aded-9b40-4899-9b64-3fb42e077ac7@kernel.org> (raw)
In-Reply-To: <20260425215734.14116-4-lkml@antheas.dev>

On 4/25/26 16:57, Antheas Kapenekakis wrote:
> Certain platform/USB devices interact with Modern Standby firmware
> notifications. This is particularly true with Asus, where the keyboards
> are wired up to turn off their backlight during the Display Off
> notification using a predetermined delay. While for Asus Keyboards this
> does not cause an issue, it does manifest in ROG Ally devices, where the
> controller waits for the animation to complete before saving its state.
> 
> In Windows, this is not a problem, because there is an ample delay after
> these calls and before LPS0, typically seconds to minutes.
> 
> Therefore, introduce a delay quirk after these calls, to ensure affected
> devices have time to uninitialize, and attach it to acpi_s2idle_dev_ops
> so it can be consumed by device drivers.
> 
> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> ---
>   drivers/acpi/x86/s2idle.c | 11 +++++++++++
>   include/linux/acpi.h      |  1 +
>   2 files changed, 12 insertions(+)
> 
> diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
> index f5aefba8b191..8b48f999e0e9 100644
> --- a/drivers/acpi/x86/s2idle.c
> +++ b/drivers/acpi/x86/s2idle.c
> @@ -16,6 +16,7 @@
>    */
>   
>   #include <linux/acpi.h>
> +#include <linux/delay.h>
>   #include <linux/device.h>
>   #include <linux/dmi.h>
>   #include <linux/suspend.h>
> @@ -517,6 +518,9 @@ static struct acpi_scan_handler lps0_handler = {
>   
>   static int acpi_s2idle_begin_lps0(void)
>   {
> +	struct acpi_s2idle_dev_ops *handler;
> +	int delay = 0;
> +
>   	if (!lps0_device_handle || sleep_no_lps0)
>   		return acpi_s2idle_begin();
>   
> @@ -552,6 +556,13 @@ static int acpi_s2idle_begin_lps0(void)
>   					lps0_dsm_func_mask_microsoft,
>   					lps0_dsm_guid_microsoft);
>   
> +	list_for_each_entry(handler, &lps0_s2idle_devops_head, list_node) {
> +		if (handler->begin_delay && handler->begin_delay > delay)
> +			delay = handler->begin_delay;
> +	}
> +	if (delay > 0)
> +		msleep(delay);

Is this the correct location?  You wouldn't want it at the check callback?

> +
>   	return acpi_s2idle_begin();
>   }
>   
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 4d2f0bed7a06..a416e5c5798a 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -1154,6 +1154,7 @@ struct acpi_s2idle_dev_ops {
>   	void (*prepare)(void);
>   	void (*check)(void);
>   	void (*restore)(void);
> +	int begin_delay;
>   };
>   #if defined(CONFIG_SUSPEND) && defined(CONFIG_X86)
>   int acpi_register_lps0_dev(struct acpi_s2idle_dev_ops *arg);


  reply	other threads:[~2026-04-28  1:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-25 21:57 [RFC v2 00/10] acpi/x86: s2idle: Introduce and implement hint class ABI and idle hint for s2idle Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 01/10] acpi/x86: s2idle: Rename LPS0 constants so they mirror their function Antheas Kapenekakis
2026-04-26 14:14   ` Rafael J. Wysocki
2026-04-26 16:54     ` Antheas Kapenekakis
2026-04-27 15:07       ` Rafael J. Wysocki
2026-04-25 21:57 ` [RFC v2 02/10] acpi/x86: s2idle: Move Modern Standby calls to s2idle begin/end Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 03/10] acpi/x86: s2idle: Add support for adding a delay after begin MS calls Antheas Kapenekakis
2026-04-28  1:57   ` Mario Limonciello [this message]
2026-04-28  7:47     ` Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 04/10] platform/x86: asus-wmi: add s2idle begin delay for Ally devices Antheas Kapenekakis
2026-04-28  1:56   ` Mario Limonciello
2026-04-28  6:34   ` [systemd-devel] " Paul Menzel
2026-04-28  8:18     ` Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 05/10] HID: asus: remove quirk handling " Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 06/10] platform/x86: asus-wmi: Remove Ally s2idle resume fixes Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 07/10] Documentation: Add documentation for the new sysfs hints class Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 08/10] hint: Add hint class ABI for devices to receive updates on host activity Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 09/10] acpi/x86: s2idle: Listen to idle hints to perform MS transitions Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 10/10] acpi/x86: s2idle: Subtract delay from last DSM fire in begin delay Antheas Kapenekakis

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=3841aded-9b40-4899-9b64-3fb42e077ac7@kernel.org \
    --to=superm1@kernel.org \
    --cc=bob.beckett@collabora.com \
    --cc=bookeldor@gmail.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=hadess@hadess.net \
    --cc=jaap@haitsma.org \
    --cc=kernel@collabora.com \
    --cc=lennart@poettering.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@antheas.dev \
    --cc=mccann@jhu.edu \
    --cc=rafael@kernel.org \
    --cc=richard@hughsie.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=systemd-devel@lists.freedesktop.org \
    --cc=xaver.hugl@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