Repository navigation
soc: apple: mailbox: Do not sleep past free FIFO space (aurora-wip rebase) - #630
Merged
Merged
Conversation
A sleeping sender that finds the send FIFO full waits on tx_empty for the send-empty interrupt, and gives up after 500 ms. Two things make it miss free space and time out with room in the FIFO: - The interrupt reports an empty FIFO. A firmware that takes some of the queued messages but not all of them frees space without raising it. - Two senders can wait at once, for example a driver starting its endpoints while the RTKit work item acknowledges a syslog message. The handler masks the interrupt and calls complete(), which wakes only one of them. The other sleeps on with the interrupt masked. A sender that timed out also masked it, stranding any sender still waiting. On the J616s (M4 Pro) this delayed the AOP start on some warm boots. One endpoint start failed 504 ms after it was issued, while the AOP firmware was logging over syslog: 2.891389 aop: ep 0x28 init sent 3.395337 aop: Failed to send management message type 0x05: -110 3.395341 aop: Retrying unsent endpoint start 0x29 3.395354 aop: ep 0x2b init sent 3.402107 aop: syslog message: ... AOP IS READY The retry and the next three requests went out within 20 us, so the FIFO had room when the first send gave up, and the firmware reported ready 7 ms later. In an earlier boot the same stall made an AFK init time out after the firmware had reported ready, and the probe failed. Wake every waiter with complete_all(), and check the FIFO again every 2 ms while waiting, until the same 500 ms deadline. A woken sender that still finds the FIFO full rearms the interrupt before it waits, as before. A sender that times out now leaves the interrupt unmasked for the others. tx_irq_unmasked still records the state, so the enable stays balanced: the handler masks it when it fires, and provider removal masks it otherwise. Atomic senders, which poll, are unchanged. Rebased onto aurora-wip, which has the TX wait failed report. That report now prints once, at the deadline of an interrupt-driven wait. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 30, 2026
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.
Replaces #596, which conflicts with aurora-wip.
This is the same change rebased onto aurora-wip. aurora-wip has the
TX wait failedreport from d9d9ee6. The resolution keeps this change's behaviour (complete_all(), a recheck every 2 ms, the interrupt left unmasked for other senders on a timeout) and prints that report once, at the 500 ms deadline of an interrupt-driven wait, so the G17 no-IRQ path stays quiet.drivers/soc/apple/mailbox.candinclude/linux/soc/apple/mailbox.hare byte for byte the files in 46b7a93f14c0, the resolved commit that fleet10 (7.3.0-aurora-fleet10) carries.Testing (from #596, on fleet10)
Failed to send management message, 0TX wait failed, 0AFK init not sent.🤖 Generated with Claude Code