One-Line Linux Patch Fixes AMD s2idle Failures For Some Ryzen Laptops

Written by Michael Larabel in AMD on 2 December 2021 at 12:00 AM EST. 8 Comments
AMD
Over the past year there has been a lot of work for getting AMD's suspend-to-idle "s2idle" support in order under Linux and the latest is a one-line code change expected to help at least some Ryzen laptops behave properly.

Over the past year has been a lot of AMD s2idle work for increased power-savings under Linux, which has meant a lot of fixing and code handling. The latest is a "lucky fix" with a one line change that is fixing some s2idle failures.

This patch to cut the AMD PMC driver polling delay from 100 micro-seconds to 50 micro-seconds is enough to fix some laptops from experiencing s2idle failures, potentially more common when running on battery power.


Fabrizio Bertocci who reported the issue and ultimately submitted a patch to change the default delay found this fixed his HP Pavilion Aero Laptop 13 with Ryzen 7 5800U for s2idle on battery power. The prior 100us delay worked fine on AC power, but would fail on battery power. After debugging this issue with AMD Linux developers, by chance it was figured out that simply halving this delay would workaround the problem.

The debugging adventure for this current-generation HP laptop can be found via this Gitlab issue thread. The patch changes the default value unconditionally and it's not known how many different AMD Ryzen laptops may be affected, so if you have had s2idle failures it may be worth trying out. The patch is currently in the x86 platform drivers tree as a fix and is marked for going to the stable branches once merged, so in the near future it should ultimately work its way out to supported stable Linux kernel series.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week