Linux Documentation
 help / color / mirror / Atom feed
* [PATCH 0/2] Document amd_pmc delay_suspend quirk
@ 2026-06-24 12:43 Daniel Gibson
  2026-06-24 12:43 ` [PATCH 1/2] Documentation/arch/x86/amd-debugging: Add example for reset register Daniel Gibson
  2026-06-24 12:43 ` [PATCH 2/2] Documentation/arch/x86/amd-debugging: Add section about delay_suspend Daniel Gibson
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Gibson @ 2026-06-24 12:43 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Jonathan Corbet, Shuah Khan, linux-kernel,
	linux-doc, Ilpo Järvinen
  Cc: Daniel Gibson

Recently I submitted patches that work around an EC bug in some Lenovo
IdeaPad laptops by adding a quirk to amd_pmc that is enabled
automatically for detected devices and can be enforced (to test on
possibly affected devices that aren't detected yet) with the
delay_suspend module parameter. The quirk makes the kernel sleep
for 2.5 seconds before actually suspending.

Now that those patches are in mainline and their commit IDs are known,
I submit the documentation for them, which refers the commit IDs.

There's also another small change to the same documentation file that
clarifies how to identify kernel log lines with information from the
reset register, because so far it was only mentioned that this
information is logged, but not how to find it.

See also https://bugzilla.kernel.org/show_bug.cgi?id=221383 and
https://lore.kernel.org/platform-driver-x86/20260611150426.3683372-1-daniel@gibson.sh/T/#u

These documentation changes were last discussed here:
https://lore.kernel.org/platform-driver-x86/20260509013105.816339-5-daniel@gibson.sh/t/#u

Daniel Gibson (2):
  Documentation/arch/x86/amd-debugging: Add example for reset register
  Documentation/arch/x86/amd-debugging: Add section about delay_suspend

 Documentation/arch/x86/amd-debugging.rst | 30 ++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

-- 
2.48.1


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

* [PATCH 1/2] Documentation/arch/x86/amd-debugging: Add example for reset register
  2026-06-24 12:43 [PATCH 0/2] Document amd_pmc delay_suspend quirk Daniel Gibson
@ 2026-06-24 12:43 ` Daniel Gibson
  2026-07-01 22:21   ` Mario Limonciello
  2026-06-24 12:43 ` [PATCH 2/2] Documentation/arch/x86/amd-debugging: Add section about delay_suspend Daniel Gibson
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Gibson @ 2026-06-24 12:43 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Jonathan Corbet, Shuah Khan, linux-kernel,
	linux-doc, Ilpo Järvinen
  Cc: Daniel Gibson, Mario Limonciello (AMD)

The amd debugging documentation didn't state how to identify kernel log
lines with information from the reset register about the cause of a
previous random reboot.

The added example rectifies this.

Suggested-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Daniel Gibson <daniel@gibson.sh>
---
 Documentation/arch/x86/amd-debugging.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/arch/x86/amd-debugging.rst b/Documentation/arch/x86/amd-debugging.rst
index d92bf59d62c7..3176a1240fee 100644
--- a/Documentation/arch/x86/amd-debugging.rst
+++ b/Documentation/arch/x86/amd-debugging.rst
@@ -366,3 +366,8 @@ There are 6 classes of reasons for the reboot:
 This information is read by the kernel at bootup and printed into
 the syslog. When a random reboot occurs this message can be helpful
 to determine the next component to debug.
+
+For example, if bit 19 was set, you will get a message like this in the log on
+next bootup::
+
+  x86/amd: Previous system reset reason [0x00080000]: software wrote 0x6 to reset control register 0xCF9
-- 
2.48.1


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

* [PATCH 2/2] Documentation/arch/x86/amd-debugging: Add section about delay_suspend
  2026-06-24 12:43 [PATCH 0/2] Document amd_pmc delay_suspend quirk Daniel Gibson
  2026-06-24 12:43 ` [PATCH 1/2] Documentation/arch/x86/amd-debugging: Add example for reset register Daniel Gibson
@ 2026-06-24 12:43 ` Daniel Gibson
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Gibson @ 2026-06-24 12:43 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Jonathan Corbet, Shuah Khan, linux-kernel,
	linux-doc, Ilpo Järvinen
  Cc: Daniel Gibson

Some Lenovo IdeaPad Slim 3 devices and similar with AMD CPUs (so far
observed with Zen3 and Zen3+ CPUs) have a nonfunctional keyboard and
lid switch after s2idle.

It helps to delay suspend by 2.5 seconds so the EC has some time
to do whatever it needs to get done before suspend.

Devices known to be affected are matched automatically, others can
enforce the delay with a amd_pmc module parameter.

This is now documented in amd-debugging.rst

Signed-off-by: Daniel Gibson <daniel@gibson.sh>
---
 Documentation/arch/x86/amd-debugging.rst | 25 ++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Documentation/arch/x86/amd-debugging.rst b/Documentation/arch/x86/amd-debugging.rst
index 3176a1240fee..3725adb42673 100644
--- a/Documentation/arch/x86/amd-debugging.rst
+++ b/Documentation/arch/x86/amd-debugging.rst
@@ -249,6 +249,31 @@ state entry.
 
 `commit 40b8c14936bd2 ("drm/amd/display: Disable unneeded hpd interrupts during dm_init") <https://git.kernel.org/torvalds/c/40b8c14936bd2>`_
 
+Keyboard and Lid Switch stop working after resume
+-------------------------------------------------
+On various variants of the Lenovo IdeaPad Slim 3 with Barcelo and Rembrandt CPUs
+the lid switch and keyboard, or at least the Fn/Multimedia keys, stopped working
+after resume, until the next reboot.
+
+This was caused by buggy firmware having timing probles, the EC needed some idle
+time right before the CPU cores are suspended, or it got into an inconsistent state.
+
+For laptops that are known to be affected this workaround is enabled
+automatically, to test this workaround on other machines you can set the
+``delay_suspend`` parameter of the ``amd_pmc`` module.
+
+If you need to set the ``delay_suspend`` parameter to fix your machine, please
+report this at platform-driver-x86@vger.kernel.org for it to be added to the
+list of devices that need this workaround, so in future kernel versions it's
+enabled automatically.
+
+Note that the current workaround isn't perfect: On some devices the problems still
+happen if resume is triggered by a timer (wakealarm).
+
+`commit 9b9e60dd31da0 ("platform/x86/amd/pmc: Delay suspend for some Lenovo Laptops") <https://git.kernel.org/torvalds/c/9b9e60dd31da0>`_
+
+`commit 428b9fd2dce50 ("platform/x86/amd/pmc: Add delay_suspend module parameter") <https://git.kernel.org/torvalds/c/428b9fd2dce50>`_
+
 Runtime power consumption issues
 ================================
 
-- 
2.48.1


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

* Re: [PATCH 1/2] Documentation/arch/x86/amd-debugging: Add example for reset register
  2026-06-24 12:43 ` [PATCH 1/2] Documentation/arch/x86/amd-debugging: Add example for reset register Daniel Gibson
@ 2026-07-01 22:21   ` Mario Limonciello
  0 siblings, 0 replies; 4+ messages in thread
From: Mario Limonciello @ 2026-07-01 22:21 UTC (permalink / raw)
  To: Daniel Gibson, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Jonathan Corbet, Shuah Khan,
	linux-kernel, linux-doc, Ilpo Järvinen

On 6/24/26 07:43, Daniel Gibson wrote:
> The amd debugging documentation didn't state how to identify kernel log
> lines with information from the reset register about the cause of a
> previous random reboot.
> 
> The added example rectifies this.
> 
> Suggested-by: Mario Limonciello (AMD) <superm1@kernel.org>
> Signed-off-by: Daniel Gibson <daniel@gibson.sh>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
>   Documentation/arch/x86/amd-debugging.rst | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/arch/x86/amd-debugging.rst b/Documentation/arch/x86/amd-debugging.rst
> index d92bf59d62c7..3176a1240fee 100644
> --- a/Documentation/arch/x86/amd-debugging.rst
> +++ b/Documentation/arch/x86/amd-debugging.rst
> @@ -366,3 +366,8 @@ There are 6 classes of reasons for the reboot:
>   This information is read by the kernel at bootup and printed into
>   the syslog. When a random reboot occurs this message can be helpful
>   to determine the next component to debug.
> +
> +For example, if bit 19 was set, you will get a message like this in the log on
> +next bootup::
> +
> +  x86/amd: Previous system reset reason [0x00080000]: software wrote 0x6 to reset control register 0xCF9


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

end of thread, other threads:[~2026-07-01 22:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24 12:43 [PATCH 0/2] Document amd_pmc delay_suspend quirk Daniel Gibson
2026-06-24 12:43 ` [PATCH 1/2] Documentation/arch/x86/amd-debugging: Add example for reset register Daniel Gibson
2026-07-01 22:21   ` Mario Limonciello
2026-06-24 12:43 ` [PATCH 2/2] Documentation/arch/x86/amd-debugging: Add section about delay_suspend Daniel Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox