Repository navigation
spmi: apple: recover every generation 4 controller from a failed exchange - #2309
RyanTheTide wants to merge 1 commit into
Conversation
…ange After a failed exchange a generation 4 controller (apple,t8142-spmi: T8142 and T6050) has no known FIFO flush, so the driver reads the late or stray reply words out before the next command. That recovery ran only on a board list (J714s, J716c, J813, J815); every other generation 4 board refused all later commands on the bus for the rest of the boot, the PMU's RTC among them. The reply FIFO and its read-out are the controller's, the same on every board with it, and the recovery is bounded: it waits one command timeout, reads at most SPMI_GEN4_REPLY_DRAIN_MAX words, and keeps the failure if the FIFO does not empty. Run it for every generation 4 controller. The earlier generations keep their FIFO flush; the generation is the match data (!legacy_irqs), as before. The recovery was written by Diljit Singh and extended by Nick and Erik Bourget. Fixes: e6b75c3 ("spmi: apple: J714s: recover from a failed exchange on a generation 4 controller") Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
No blockers. Checked at 53f5d6c: apple_spmi_gen4_recover() (drivers/spmi/spmi-apple-controller.c:241) only runs from __spmi_raw_cmd() with
HW row: nice to have, not needed to merge: a generation 4 Mac that was not on the old list (J704, J714c or K114c) booted on the head, with 0 new spmi errors and a working RTC after 3x s2idle. Lab Macs do not reach this code. Assisted-by: LLM (Claude:Opus 5.5) |
|
Adversarial pass at 53f5d6c: no blockers. One small point:
Assisted-by: LLM (Claude:Opus 5.5) |
Problem
drivers/spmi/spmi-apple-controller.c:241-247(0abc2f3) ran the generation 4 recovery after a failed exchange only on a list of boards: J714s, J716c, J813 and J815. The recovery reads out late reply words. The list came from e6b75c3 and was extended in 446bb99 and 81c725d. On any other generation 4 board, one failed exchange made the driver refuse every later command on that bus until the next boot, and the PMU's RTC went with it.Change
The board list is removed. The recovery belongs to the controller's reply FIFO, so it now runs on every generation 4 controller. Generation 4 is the match data (
apple,t8142-spmi,!legacy_irqs), as before. Earlier generations keep their FIFO flush.The recovery is bounded. It waits one command timeout, then reads at most
SPMI_GEN4_REPLY_DRAIN_MAXwords. If the FIFO still does not empty, the failure stays. On a board where nothing goes wrong, it never runs.The recovery was written by Diljit Singh and extended by Nick and Erik Bourget.
Testing
make W=1 drivers/spmi/spmi-apple-controller.o. No new warnings.Still to run
None of our lab Macs has a generation 4 controller. Neo T8140, J616s T6040, M1 Pro T6000 and M2 T8112 all bind the
apple,t8103-spmiorapple,t6000-spmimatch data. On them, a boot withdmesg | grep -i spmishowing no new messages is enough.Reach and safety
New reach: T8142 J704 and the T6050 boards that were not on the list (J714c, J716s, K114s, K114c, K116s, K116c, J873s, J775c, J775d). They all use the same
apple,t6050-spmi/apple,t8142-spmicontroller as the J714s and J813. The code runs only after a failed exchange, and the alternative is a bus that stays dead for the rest of the boot.Assisted-by: LLM (Claude:Opus 5.5)