Repository navigation
PM: sleep: don't log a prepare -EAGAIN skip as an error - #3757
Merged
Merged
Conversation
dpm_prepare() treats -EAGAIN from device_prepare() as "skip this device": it clears the error and carries on with the suspend. But device_prepare() still reports it through suspend_report_result(), at error level. dwc3-apple returns -EAGAIN from its prepare when it has made itself a syscore device for the sleep, after genpd has counted the prepare, so that genpd unwinds prepared_count. Every s2idle on every Mac with that controller therefore logs, once per port: dwc3-apple 402280000.usb: PM: device_prepare(): genpd_prepare returns -11 The suspend goes on. Nothing failed, but the line reads like a failure and keeps coming up in sleep triage. Log the -EAGAIN skip at debug level and keep the error report for real failures. Signed-off-by: Ryan Murray <[email protected]>
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: MERGE at 1846458
Checked:
dpm_prepare()at this head still turns-EAGAINinto "skip and carry on" (else if (error == -EAGAIN) error = 0;), so the device is skipped exactly as before; only the log level of that one return code changes. Every other negative return still goes throughsuspend_report_result(), and the "not prepared for power transition" info line indpm_prepare()is untouched.- The
-EAGAINbranch keeps the same unwind as the error path (pm_runtime_unblock()+pm_runtime_put()+return ret), so the runtime-PM balance is unchanged. device_prepare()has one caller (dpm_prepare()), so no other path relies on the error-level line.callbackcan be NULL only whenretstays 0, so the%psin the newdev_dbg()never prints a stray pointer for a skipped device.dwc3_apple_pm_prepare()at this head keeps-EAGAINfor the syscore retry only (a completed worker error is turned into-EBUSY), which matches the claim.- No Apple-derived material, no AI attribution. host-tests, pr-text and readiness are green at this head.
Follow-ups:
- A driver that returns
-EAGAINfrom prepare by mistake now logs only at debug level. The PR already says so under Risk; nothing to do unless one shows up.
DjDeveloperr
approved these changes
Dec 1, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
The log-level change applies only to -EAGAIN, which dpm_prepare() already handles as a skip. Runtime PM cleanup, the returned status and reporting for other errors are preserved. Host CI and the J473 suspend and USB recovery row pass at this head.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
dwc3-applereturns-EAGAINfrom prepare on purpose (dwc3_apple_pm_prepare(): syscore retry, so genpd unwindsprepared_count).dpm_prepare()treats-EAGAINas "skip this device" and goes on, butdevice_prepare()still reports it at error level. So every s2idle on every Mac with that controller logs once per port:Nothing has failed. The suspend goes on as designed, but the line looks like a failure and keeps coming up in sleep triage (J713 eGPU sleep rows, J473/J615/J616s/M1 Pro/Neo traces). This change logs the
-EAGAINskip at debug level and keepssuspend_report_result()for every other error. No behaviour change:dpm_prepare()'s handling is untouched.Tested
make W=1 drivers/base/power/main.o(arm64, LLVM, J473 m2combo30 config) at18464585: builds clean.18464585(kernel tree 74ddf83 = linux#3647 + drm/apple: dcp: leave the piodma DART alone at shutdown after DPMS off #3595 + this): s2idle pass, 0genpd_prepare returnslines, USB 10/10 devices back. The production J473 kernel logs two such lines per s2idle (one per dwc3 port).Risk
two-way; all Macs (PM core, logging only). A driver that returns
-EAGAINfrom prepare by mistake now logs at debug, not error; its device is skipped exactly as before.Not yet