Repository navigation
Conversation
On J813 the N1 firmware can stop while the machine is awake. A background scan sees the Alpha execution stage leave 2 and ends with -EIO, and every later command finds the command ring full. Nothing brought Wi-Fi back short of a reboot: PERST# alone, through the existing port cycle, leaves the firmware running. Restart the chip from the driver: - Release btcentauri and free the firmware's buffers. - Remove functions 1 and 2. The reset returns the chip to its single-function ROM personality, and a read through a stale function's BAR afterwards hangs the fabric. - Cycle the port with the N1's warm reset, given while the port is down. The chip comes back in stage 0. - Run the probe's boot steps, then attach the Beta function again. The warm reset comes from the root port's DT node, with the properties and parsing the T6050 boards already use (bindings/pci/apple,pcie.yaml): apple,function-warm-reset names the SMC and the key (the ADT's pci-bridge0 function-warm_reset), apple,warm-reset-writes the writes. A board restarts only when its root port has both and its port cycle is known; without them the driver never resets the chip. J813 gets them: key 'bpli', the same key and argument as the T6050 boards, with the T6050 writes. The Wi-Fi code reports the signs where it already sees them: the scan loop's and command_control()'s stage checks, a full command ring and a command timeout. A report queues a check 2 s later on an ordered, freezable workqueue, which restarts the chip only if the firmware is still stopped and the transport is not paused for a system sleep. At most three restarts in 30 minutes. There is no runtime switch; a board without the DT properties doesn't restart. debugfs rom_boot 4 restarts by hand, 5 and 6 test the fault path as a stopped firmware and as a fault that clears. The status file now reads under boot_lock, so no BAR read lands in a restart's port cycle. The driver now depends on MFD_MACSMC. Known limit, shared with the debugfs boot steps: removing function 0 under the PCI rescan lock (sysfs remove, host unbind) while a restart runs deadlocks. Signed-off-by: Kyle Arrington <kyle@arrington.co>
|
Nice work. Keying the restart on the root port's warm-reset properties, so a board without them never resets the chip, is the right shape. Points from a read of the head:
Rows: the automatic path on a firmware that stopped by itself (as you list). Also one J714s/J716c boot, since their root ports already carry both properties. Even if centauri doesn't bind there, it shows nothing new runs. Assisted-by: LLM (Claude:Opus 5.5) |
|
I'm stepping back from this one. The branch stays up and maintainer edits are enabled, so take it, rework it, or close it as you see fit. The code is GPL-2.0 under my Signed-off-by; use it however helps. Assisted-by: LLM (Claude:Opus 5.5) |
|
Natural-hang row, for whoever picks this up: the firmware stopped on its own on my J813, and the automatic path restarted it. Setup. The recovery code is the same as this head ( What happened (2026-11-21, 10 h 31 min after boot, machine awake):
Not clean: about 5 minutes of access-point hopping after the restart.
Assisted-by: LLM (Claude:Opus 5.5) |
|
Still needed: nothing on integration/aurora at daa9e2d restarts a stopped N1 firmware on T8142, and cebbad4 merges onto that tip without conflicts. The author has handed the branch over, so it needs someone to carry it. Open from the review: the two fixed 2 s waits in |
Replaces #2648: the same commit (
cfcac75a's tree), without theAssisted-bycommit trailer.On my J813 (MacBook Air 13" M5, macOS 27.2 stub) the N1 firmware stopped twice while the machine was awake, about five hours after boot each time (11-19 and 11-20). A background scan ends
rc=-5partway through (12 and 13 of 38 channels), wpa_supplicant disconnects in the same second, and from then on every command returns-ENOSPCbecause the firmware no longer drains the command ring. The firmware writes nothing to itscrasregion. Until now only a reboot brought Wi-Fi back.This lets the driver restart the chip itself.
The restart
Which boards
pci/apple,pcie.yaml, read the same way as pcie-apple does):apple,function-warm-resetnames the SMC and the key (the ADT'spci-bridge0function-warm_reset), andapple,warm-reset-writesgives the writes.<&smc 0x62706c69 0x1000000>(its ADT'sfunction-warm_reset, the same key and argument as the J714s) and the J714s writes. The N1 binding notes them.When it runs
command_control()'s Alpha-stage checks, a full command ring, and a command timeout.rom_boot4 restarts by hand; 5 and 6 test the path as a stopped firmware and as a fault that clears.Also:
statusnow reads underboot_lock, so no BAR read lands in a restart's port cycle, andAPPLE_CENTAURInow depends onMFD_MACSMC.Tested on J813
Bluetooth function attach: 1).-EOPNOTSUPP.firmware_crashandstatusthroughout a restart doesn't hang.Known limit: removing function 0 under the PCI rescan lock (sysfs
remove, host unbind) while a restart runs deadlocks: remove waits for the restart, which waits for the rescan lock. The debugfs boot steps already have the same shape.Builds clean with
W=1onintegration/aurora(5b596e6e377a).dt_binding_checkpasses for the N1 binding. On J813,dtbs_checkreports only an alias warning that was already there. It doesn't validate the new properties, because J813'spcie0ispci-host-ecam-generic.Assisted-by: LLM (Claude:Opus 5.5)