Skip to content

PM: sleep: don't log a prepare -EAGAIN skip as an error - #3757

Merged
DjDeveloperr merged 1 commit into
mainfrom
b7/pm-prepare-eagain-quiet
Dec 1, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
b7/pm-prepare-eagain-quiet

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

What

dwc3-apple returns -EAGAIN from prepare on purpose (dwc3_apple_pm_prepare(): syscore retry, so genpd unwinds prepared_count). dpm_prepare() treats -EAGAIN as "skip this device" and goes on, but device_prepare() still reports it at error level. So every s2idle on every Mac with that controller logs once per port:

dwc3-apple 402280000.usb: PM: device_prepare(): genpd_prepare returns -11

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 -EAGAIN skip at debug level and keeps suspend_report_result() for every other error. No behaviour change: dpm_prepare()'s handling is untouched.

Tested

Risk

two-way; all Macs (PM core, logging only). A driver that returns -EAGAIN from prepare by mistake now logs at debug, not error; its device is skipped exactly as before.

Not yet

  • Nothing for this claim.

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]>
@RyanTheTide
RyanTheTide requested review from a team as code owners December 1, 2026 06:45
@github-actions github-actions Bot added blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at 18464585: not ready yet

Check Detail
CI at head ok 4 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 18464585
Conflicts ok none
PR text ok Risk: two-way · all Macs (PM core, logging only). A driver that returns -EAGAIN from prepare by mistake now logs at debug, not error; its device is skipped exactly as before.

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 1846458

Checked:

  • dpm_prepare() at this head still turns -EAGAIN into "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 through suspend_report_result(), and the "not prepared for power transition" info line in dpm_prepare() is untouched.
  • The -EAGAIN branch 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.
  • callback can be NULL only when ret stays 0, so the %ps in the new dev_dbg() never prints a stray pointer for a skipped device.
  • dwc3_apple_pm_prepare() at this head keeps -EAGAIN for 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 -EAGAIN from prepare by mistake now logs only at debug level. The PR already says so under Risk; nothing to do unless one shows up.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DjDeveloperr
DjDeveloperr merged commit d148fbd into main Dec 1, 2026
7 checks passed
@DjDeveloperr
DjDeveloperr deleted the b7/pm-prepare-eagain-quiet branch December 1, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants