Whether this bug is worth fixing, we need to consider the whole picture:

- The delay is fundamentally the physical spin-up time of a HDD returning from 
STANDBY, which is unavoidable regardless of kernel.
- The only reason it blocks the resume path is that 95hdparm-apm runs hdparm 
synchronously inside the sleep hook.
- A system without the hdparm package already resumes immediately and lets the 
disk spin up in the background. The hdparm hook is causing the anomaly.
- On this machine the disk is unmounted, so there is no functional impact from 
resuming before it is ready.

Possible fix (if we decide to fix it):

Make the resume hook launch hdparm outside the systemd-suspend.service cgroup 
so it no longer gates resume completion, with a fallback for non-systemd 
systems:
--- a/debian/extra/95hdparm-apm
+++ b/debian/extra/95hdparm-apm
@@ resume_hdparm_apm()
             if [ -n "$apm_opt" ]; then
 -                hdparm $apm_opt $dev
 +                # Avoid blocking the suspend service while libata EH holds the
 +                # SCSI queue frozen during disk spin-up (LP: #2160187).
 +                if command -v systemd-run >/dev/null 2>&1; then
 +                    systemd-run --no-block --quiet -- hdparm $apm_opt $dev
 +                else
 +                    hdparm $apm_opt $dev
 +                fi
             fi
@@ resume_hdparm_spindown()
                 if [ -n "$apm_opt" ]; then
-                    hdparm $apm_opt $dev
+                    if command -v systemd-run >/dev/null 2>&1; then
+                        systemd-run --no-block --quiet -- hdparm $apm_opt $dev
+                    else
+                        hdparm $apm_opt $dev
+                    fi
                 fi

Tested on the affected machine (6.17.0-1029-oem, no nohdparm): 5
consecutive fwts s3 cycles all showed resume 0.44s (down from ~6.9s)
with hardware sleep at 91-93%. The APM level is still correctly applied
to the disk ~6s later once EH completes (verified via journal:
hdparm[...]: APM_level = 254), so drive power management behavior is
preserved.

** Changed in: linux-oem-6.17 (Ubuntu)
       Status: New => Triaged

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2160187

Title:
  Suspend resume time is longer than the threshold on Dell Pro Tower
  QCT1255.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-oem-6.17/+bug/2160187/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to