Skip to content

media: apple: isp: power the T8132 ISP down as macOS does - #1918

Open
IronsideXXVI wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
IronsideXXVI:j604-t8132-isp-macos-stop
Open

IronsideXXVI wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
IronsideXXVI:j604-t8132-isp-macos-stop

Conversation

@IronsideXXVI

@IronsideXXVI IronsideXXVI commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

On T8132, the camera's first stream after system boot failed its ISP firmware boot once. The next open streamed. Reading the ISP's MMIO in two macOS camera sessions on a J604 (14" MacBook Pro M4) showed that macOS never writes the coprocessor control word 0 when it powers the ISP down. This driver wrote it 0 at every power-down on everything but T8140.

This patch leaves the control word alone on T8132 by default, as macOS does, and as the driver already does on T8140 for its own reason. The next boot then accepts the start word (0x10) that the domain kept, and still writes 0 then 0x10 as for a fresh start. apple_isp.macos_stop=N restores the old power-down. Other SoCs are unchanged.

Measured on the J604 (MEASURED 2026-11-14), with the same change in our kernel series, a true first open after boot (no earlier ISP boot in that boot's log): on three of three boots (our kernels 1.908 twice and 1.909 once; on 1.909 with the kernel's other first-open change switched off, so this one was tested alone), the first open streamed 30 of 30 frames in each of two runs, with 0 "failed to start camera" and 0 firmware boot retries. On our kernels up to 1.907, without it, the first open after boot failed: its firmware boot got no answer. (third check added 2026-11-14 18:00 UTC).

Please note that the change as it ran on the J604 also stopped writing the fabric words at power-down, in a core-park path that is in our series but not in integration/aurora. integration/aurora writes no fabric words at power-down, so only the control-word part applies here. This exact patch has been built on integration/aurora 7c71d6d (checkpatch --strict 0/0/0, drivers/media/platform/apple/isp/ builds with W=1 and no warnings), but it has not been run on its own on the J604.

Update 2026-11-14 18:50 UTC: our kernel series carried three earlier workarounds for this failure (a 1.5 s minimum off time, a firmware boot retry and keeping the detecting firmware up). With this change alone the first open passed, so the next J604 kernel drops all three. This patch is the whole fix we propose; nothing else from that series is needed.

macOS powers the J604's ISP (M4 MacBook Pro 14", T8132) down without
writing the coprocessor control word 0; read from the ISP's MMIO in two
macOS camera sessions. This driver writes it 0 at every power-down on
everything but T8140.

On T8132 leave it alone by default and let the next boot accept the
start word (0x10) the domain kept after such a power-down; the boot
still writes 0 then 0x10. macos_stop=N gives back the old power-down.

Assisted-by: LLM
Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
@davishann15-commits

Copy link
Copy Markdown

Tested on a J604 (MacBook Pro 14", M4, Mac16,1; os-fw 26.6.2, system-fw 27.0; aura 1.0.0b13). The kernel was alarm-aurora's pkgrel 38 recipe on integration/aurora 7c71d6d, plus #1543, #1894, #1895, #1917, #1918, #1919 and #1922. It booted on its own J604 tree as an aura-try trial. Userspace: Hyprland 0.57.2, mesa-aurora 26.3.0_devel.202611130318, speakerguardd-v2 1.0.0alpha.1-40.

macos_stop=Y. The first camera open after boot (no earlier ISP boot in that boot's log) streamed 30 frames with v4l2-ctl --stream-mmap. A second open a few seconds later did too, with no ISP errors in the log. One boot only (you measured three of three).


Disclosure: an LLM (Claude) ran these tests on my Mac and drafted this. I did the listening and looking, reviewed it, and am responsible for it.

Assisted-by: LLM

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for tracking down the first-open ISP boot failure and comparing it against macOS's power-down.

We select behaviour by a hardware property, not by the chips it was checked on. The reason given here is macOS behaviour, but it is enabled only on T8132 through match data (drivers/media/platform/apple/isp/isp-drv.c:1294, .macos_stop = true in apple_isp_hw_t8132), and a new module parameter can switch it off (drivers/media/platform/apple/isp/isp-fw.c:32-35, used at isp-fw.c:494 and :509).

Could you either make "leave the coprocessor control word alone at power-down" the default for every ISP generation, or, if some generation really needs the old write, keep the flag for that generation only and note the hardware reason in a code comment? Please also drop macos_stop as a module parameter: a driver behaviour should not need a boot option.

If you make it the default, we can run camera first-open rows on our M1 Pro, M2, M4 Pro and A18 Pro.

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.

3 participants