Repository navigation
Conversation
|
The recovery itself looks careful. btcentauri is released first, functions 1 and 2 are removed before the reset (avoiding the stale-BAR fabric hang), the warm reset is given with the port down, the check runs 2 s later on a freezable workqueue and skips a paused transport, and it is capped at three restarts per 30 minutes. Two points before it leaves draft:
Assisted-by: LLM (Claude:Opus 5.5) |
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. Assisted-by: LLM Signed-off-by: Kyle Arrington <kyle@arrington.co>
8ab4ee3 to
cfcac75
Compare
|
Both done in
The board flag is gone too. A binding for this already existed: the T6050 boards describe the N1's warm reset on the root port, with Two things I couldn't settle on my own:
J714s: this restart is in the T8142 driver, which doesn't bind on T6050 (its probe rejects a Tested on J813, with the same module both times:
Assisted-by: LLM (Claude:Opus 5.5) |
|
Replaced by #2711: the same change on a fresh branch, with only the human Signed-off-by in the commit. Closing this one. Assisted-by: LLM (Claude:Opus 5.5) |
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)