public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Gibson <daniel@gibson.sh>
To: "Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Mario Limonciello <superm1@kernel.org>, Daniel Gibson <daniel@gibson.sh>
Subject: [PATCH 0/2] amd_pmc: Delay s2idle suspend for some devices
Date: Fri,  1 May 2026 05:26:53 +0200	[thread overview]
Message-ID: <20260501032655.283789-1-daniel@gibson.sh> (raw)

On some AMD Zen3 and Zen3+-based Lenovo IdeaPad laptops the keyboard and
the lid switch stop working after the first suspend, until rebooted.

More specifically, they stop sending events when pressing a key or
closing the lid - it's still possible to toggle the capslock- and
numlock-LEDs with an external keyboard or read the lid state at
/proc/acpi/button/lid/LID/state.

See also https://bugzilla.kernel.org/show_bug.cgi?id=221383

It appears that suspending and/or resuming gets the EC into a broken
state. This problem doesn't happen on Windows and Mario Limonciello
mentioned that the Windows kernel gives hardware and software some time
before actually suspending (before activating HW DRIPS), while Linux
(or the amd_pmc module) does that immediately, so it may be worth trying
if calling msleep() in amd_pmc_s2idle_check() helps.

It turned out that sleeping for 2.5 seconds at that point indeed makes
the problems disappear. Sleeping for 1.5 seconds wasn't enough.

Luckily there was already a quirk that does exactly that under other
circumstances, so I could build on that:
https://lore.kernel.org/platform-driver-x86/20250414162446.3853194-1-superm1@kernel.org/

I enable this quirk for two lines of Lenovo Laptops that are known to
have this problem and for which the patch has been successfully tested.

I found several reports of these or similar issues on the web, for
different devices, so in a second commit I added a parameter to the
kernel module that allows enabling or disabling this, which will make
it easy for people whose devices aren't matched yet to test this quirk.

Thanks to Mario Limonciello for his support and to Sindre Henriksen
for testing my patch!

Daniel Gibson (2):
  platform/x86/amd/pmc: Delay suspend for some Lenovo Laptops
  platform/x86/amd/pmc: Add delay_suspend module argument

 drivers/platform/x86/amd/pmc/pmc-quirks.c | 36 +++++++++++++++++++++++
 drivers/platform/x86/amd/pmc/pmc.c        | 18 +++++++++++-
 drivers/platform/x86/amd/pmc/pmc.h        |  1 +
 3 files changed, 54 insertions(+), 1 deletion(-)

-- 
2.48.1


             reply	other threads:[~2026-05-01  4:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01  3:26 Daniel Gibson [this message]
2026-05-01  3:26 ` [PATCH 1/2] platform/x86/amd/pmc: Delay suspend for some Lenovo Laptops Daniel Gibson
2026-05-01  3:26 ` [PATCH 2/2] platform/x86/amd/pmc: Add delay_suspend module argument Daniel Gibson
2026-05-04 14:37   ` Mario Limonciello
2026-05-04 15:38     ` Daniel Gibson
2026-05-04 16:58       ` Mario Limonciello

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=20260501032655.283789-1-daniel@gibson.sh \
    --to=daniel@gibson.sh \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=superm1@kernel.org \
    /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