AMD Has A One-Liner To Help Speed Up Linux System Resume Time
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.
Basavaraj Natikar explained with the patch now queued in USB-next ahead of the Linux 6.5 kernel cycle:
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.
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.
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.
8 Comments