Skip to content

nvme: apple: find the linear SQ doorbells from the nvme window - #1060

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
dmitzsaz:pr/nvme-apple-lsq-window
Nov 8, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
dmitzsaz:pr/nvme-apple-lsq-window

Conversation

@dmitzsaz

@dmitzsaz dmitzsaz commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Newer ANS firmware moves the linear SQ doorbells (+0x24908/+0x24910) into the NVMMU block and ends the nvme register block at 0x10000. T6040 selects that layout by compatible (lsq_in_nvmmu).

T8142 can run either layout, depending on the ANS firmware of the macOS stub it boots. The J813 device tree describes a 0x30000 nvme block with the doorbells in it. A J704 booting the macOS 27.0 stub has them in the NVMMU, and its ADT gives the nvme block as 0x10000. With the compatible alone the driver writes the doorbells past the end of that mapping.

This takes the layout from the DT as well: if the nvme window doesn't reach the doorbells, they're in the NVMMU block and the firmware has already enabled them, as on T6040. DTs whose window covers the doorbells — including the current J813 one — behave as before.

Testing

  • MacBook Pro 14" M5 (J704), macOS 27.0 stub: root filesystem on the internal SSD, in daily use.
  • Builds on current integration/aurora (W=1; the only warnings are the existing -Wthread-safety-analysis ones on disable_lock, outside this change).
  • Not tested on J813; its behaviour is unchanged by construction (its nvme window is 0x30000).

Prepares for the J704 device tree, which describes the nvme block as the ADT does.

Prepared with Claude Opus 5.5; tested by me on the hardware.

Newer ANS firmware moves the linear submission queue doorbells
(+0x24908/+0x24910) into the NVMMU block and ends the "nvme" register
block at 0x10000, before them. T6040 selects that layout by compatible.

T8142 can run either layout, depending on the ANS firmware of the macOS
stub it boots. The J813 device tree describes a 0x30000 "nvme" block
with the doorbells in it. A J704 booting the macOS 27.0 stub has them in
the NVMMU instead, and its ADT gives the "nvme" block as 0x10000 (ans
reg[9]). With the compatible alone the driver would write the doorbells
past the end of that mapping.

Take the layout from the device tree as well: when the "nvme" window
does not reach the doorbells, they are in the NVMMU block, and the
firmware has already enabled them, as on T6040. Device trees whose
"nvme" window covers the doorbells, including the current J813 one, keep
the existing behaviour.

Tested on a MacBook Pro (14-inch, M5) J704 booting the macOS 27.0 stub:
the root filesystem on the internal SSD is used daily.

Signed-off-by: Dmitriy <noc@pimk.in>
Assisted-by: LLM
@RyanTheTide

Copy link
Copy Markdown
Contributor

Tested before merging, silent: one-shot test kernel 7.3.0-aurora-f4mtr3x/y = integration/aurora 36d9198 plus this PR, #1082, #1083, #1084, #1060 and the Touch ID series, all merged onto the current tip. It was booted once on each of the four fleet Macs (M2 J413, M1 Pro J316s, J616s M4 Pro, MacBook Neo J700), and our regression suite was compared with the fleet30 rows on the same Macs:

  • boot err-level lines and AVC: 0 on every Mac;
  • 12 suspend/resume cycles with speaker regrant;
  • Wi-Fi/BT reconnect, camera and display;
  • AVD decode bit-exact (fps within ±2%);
  • ANE runs and resumes.
    No regression came from these PRs.

For this PR in particular: built with 0 warnings. On all four Macs the nvme window reaches the linear doorbells, so lsq_in_nvmmu keeps its per-SoC value, and NVMe boot, suspend/resume and I/O behaved as on fleet30.

Thank you, Dmitriy!

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.

2 participants