Skip to content

mfd: macsmc: drain an ordinary reply before saved-lane noirq resume - #2167

Merged
DjDeveloperr merged 3 commits into
integration/aurorafrom
fix/t6050-macsmc-pending-reply-before-noirq
Nov 17, 2026
Merged

DjDeveloperr merged 3 commits into
integration/aurorafrom
fix/t6050-macsmc-pending-reply-before-noirq

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

An SMC-originated wake can leave an ordinary command reply in the mailbox when apple_smc_resume_noirq() starts, while interrupts are still disabled. The function then returns -EBUSY before sending AP ON and the NVMe firmware can time out waiting for its topology. Jens Axboe reproduced this by unplugging a USB stick during deep sleep on K116s with firmware 27.2. Hardware report

Carry Jens’s exact fix with his authorship. It polls the ordinary reply for at most 200 ms and retains saved-recovery and fault checks. This also addresses the shared path that the J716c SEP/SMC sleep stack enables in #2133. Original commit

Validation compiled the production noirq callback in a mocked transport harness. The original reproduced the refusal with a pending reply, and the fixed callback proceeded after receiving it. Missing replies, saved recovery, and saved faults retained their refusal paths.

axboe and others added 3 commits November 17, 2026 14:09
…aved lane at resume

A wake by something the SMC itself reports, such as a Type-C port's unplug,
brings a notification right behind the wake. Its handler's ordinary command
can be in flight when the noirq resume runs: posted, with its reply waiting
in the mailbox while the interrupt is still off. The resume took the pending
flag for an unresolved saved command and refused with -EBUSY. The SMC then
never got its AP ON notice, and ANS, waiting for its topology from the SMC,
asserted 10 s into the wake:

  macsmc 28c600000.smc: PM: failed to resume noirq: error -16
  nvme-apple 45dcc0000.nvme: RTKit: Message (id=1): assert failed:
    [21370]:timed out waiting for topology from SMC

Poll the mailbox until the reply is in, bounded at 200 ms, before judging
the lane. A recovery or a fault still refuses as before.

Seen on the K116s: a USB stick pulled during a deep sleep.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

(cherry picked from commit 2f579ba)
Align the mocked DCP state and helpers with the production dcp_poweron()
used by the fixture. This also covers its negative-control build paths.

Signed-off-by: Diljit Singh <hey@djdev.me>
Retain the tested production changes and use the ext26 cold-boot
fixture revision that landed in integration.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr merged commit 65d3fcf into integration/aurora Nov 17, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the fix/t6050-macsmc-pending-reply-before-noirq branch November 17, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants