AMD Has A One-Liner To Help Speed Up Linux System Resume Time

Written by Michael Larabel in AMD on 20 May 2023 at 05:43 AM EDT. 8 Comments
AMD
AMD engineers have been working out many quirks and oddities in system suspend/resume handling to make it more reliable on their hardware particularly around Ryzen laptops. In addition to suspend/resume reliability improvements and suspend-to-idle (s2idle) enhancements, one of their engineers also discovered an easy one-liner as a small step to speeding up system resume time.

AMD engineer Basavaraj Natikar realized a missing check in the USB XHCI driver can avoid an extra 120ms delay during system resume time. It's only 120 ms, but it's a broad win given it's for the XHCI driver code and part of their larger effort of improving the AMD Ryzen platform on Linux and this 120ms savings is from altering one line of code.

System resume time savings patch


Basavaraj Natikar explained with the patch now queued in USB-next ahead of the Linux 6.5 kernel cycle:
"Avoid extra 120ms delay during system resume.

The xHC controller may signal wake up to 120ms before showing which usb device caused the wake on the xHC port registers.

The xhci driver therefore checks for port activity up to 120ms during resume, making sure that the hub driver can see the port change, and won't immediately runtime suspend back due to no port activity.

This is however only needed for runtime resume as system resume will resume all child hubs and other child usb devices anyway."

Look for this 120ms system resume time savings with the Linux 6.5 kernel in a few months. As it's marked as a "fix" for an XHCI patch made by an Intel engineer back in 2021 where this 120ms delay was introduced, it's also possible that following the Linux 6.5 merge window this patch will be back-ported to existing stable Linux kernel versions.
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