One-Line Linux Patch Fixes AMD s2idle Failures For Some Ryzen Laptops
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.