Skip to content

[1/5] iommu: apple-dart: Preserve J713 radio translations across S2R - #1378

Closed
erikwb wants to merge 1 commit into
stack/j713-radio-dcpfrom
j713/radio-s2r-dart
Closed

erikwb wants to merge 1 commit into
stack/j713-radio-dcpfrom
j713/radio-s2r-dart

Conversation

@erikwb

@erikwb erikwb commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

The J713 radio DART loses register state across deep sleep while its page tables remain in memory. Add a host-owned stop/restore transaction that excludes mapping writers while the PCIe link and endpoint bus mastering are held. Restore translations, fault masks and streams before permitting DMA again.

Limit this provider to the managed J713 radio DART. Invalid snapshots and incomplete restores keep DMA blocked. Include fault-injection coverage for writer exclusion, snapshot validation and power loss.

Part 1/5 of J713 native radio S2R, stacked on #1314 at 00f5d3e3f848. stack/j713-radio-pr1314 mirrors that PR's head so each subsystem has a separate review diff in this repository.

The base branch stack/j713-radio-dcp is that head plus the DCP address/size declarations needed for a clean boot on it, which #1385 now proposes separately for integration/aurora.

Series order: #1378 → #1381 → #1382 → #1383 → #1384.

Validation on this base:

  • Full arm64 Image, modules and DTBs; DART/PCIe module and no-provider build configurations.
  • Nine focused host suites, including callback-lifetime interleavings and four rejected mutations; ASan/UBSan lifetime run; checkpatch clean for all five commits.
  • J713: clean boot, one suspend-abort/unwind test and three consecutive 31-second RTC deep sleeps on one boot. Wi-Fi gateway traffic and Bluetooth Read Local Version succeeded after every wake; all ten CPUs, internal panel, root storage and thermal checks passed without kernel warnings or taint.

Qualification covers radio recovery in the minimal sleep profile. GPU, external displays and SIO/audio were excluded, SLC allocation remained off, and paired Bluetooth traffic was not tested.

…leep

The J713 radio DART loses its register state while its live page tables
remain in memory. Let the PCIe host own its stop and restore
transaction, with mapping writers fenced while bus mastering and the
port are held. Restore translation, fault-mask and stream state before
admitting DMA.

Restrict the provider to the managed J713 radio DART. Reject corrupt
snapshots and retain the closed DMA boundary after an incomplete
restore. Add fault-injection coverage for writer exclusion, snapshots
and power loss.

Signed-off-by: Erik Bourget <erik@ebourget.net>

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes needed on 3ac93e7:

  1. apple_dart_sleep_release_failed() calls panic(), and it is reached from ordinary IOMMU paths: apple_dart_unmap_pages() and apple_dart_domain_flush_tlb_range() when the writer gate is closed, and apple_dart_release_device() whenever sleep_record is set (a PCI remove or driver unbind during the sleep window). Please replace it with a WARN plus apple_dart_managed_quarantine() and an error return, so a late unmap or unbind leaves DMA blocked without taking the system down.

  2. apple-dart.c does #include "apple-dart-sleep.c". Please build it as its own object (shared declarations in apple-dart-power.h or a private header) instead of including a .c file.

  3. apple_dart_sleep_bind() identifies the radio DART by MMIO address (res.start != 0x490000000ULL || resource_size(&res) != 0x20000). Match on the DT instead (a compatible or a property on dart_apcie0), so the code does not hardcode a physical address.

  4. apple-dart-power.h uses raw register offsets: dart_power_tunables[] (0x20c, 0x220, 0x224, 0x300, 0x308, 0x310), dart_power_tz[] (0x500..0x548), and 0x704/0x777 in dart_power_fault_pending(). Please give each register a named #define, and each mask named fields, with a short comment saying what it holds, as for the DART_T8110_* registers in apple-dart.c.

  5. CI has not run on this head.

This is stacked on stack/j713-radio-pr1314, a copy of #1314 at 00f5d3e. That PR is a draft whose commits have no Signed-off-by, so this series cannot land before it does.

@erikwb
erikwb changed the base branch from j713/dcp-iommu-address-cells to stack/j713-radio-dcp November 10, 2026 12:49
@erikwb

erikwb commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #1314 (authorship kept), which carries the J713 radio sleep work from here on. Closing in favour of it.

@erikwb erikwb closed this Nov 11, 2026
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