Skip to content

[3/5] PCI: apple: Restore the J713 native radio port after S2R - #1382

Closed
erikwb wants to merge 1 commit into
j713/radio-s2r-perstfrom
j713/radio-s2r-pcie
Closed

erikwb wants to merge 1 commit into
j713/radio-s2r-perstfrom
j713/radio-s2r-pcie

Conversation

@erikwb

@erikwb erikwb commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

PR #1314 disables the J713 radio because its native PCIe port has no recovery path after deep sleep. Restore the port, GPIOs, requester/MSI routes and DART before resuming the BCM4388 functions. Keep endpoint bus mastering disabled until the link, device identities and translation context are ready.

Both endpoint drivers must participate before sleep proceeds. A refused sleep unwinds without resetting the retained link; an unsafe recovery failure stops before other DMA users resume. Enable the J713 radio and describe CLKREQ GPIO 160 in the same change. Include lifecycle and register-failure tests.

Part 3/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.

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

Depends on #1381.

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.

Rebuild the native port, GPIOs, requester/MSI routes and DART before PCI
resumes the BCM4388 functions. Keep endpoint bus mastering disabled
until the translation context is restored and the link and identities
agree.

Require both bound endpoint drivers to participate in the sleep
transaction. A refused sleep restores the retained link without
resetting it; a failed power-loss recovery stops before other DMA users
resume. Enable the J713 radio and publish its CLKREQ GPIO with the host
support. Add host lifecycle and register-failure fixtures.

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 c856eff:

  1. apple_radio_port_restore() writes a table of 19 raw { offset, value } pairs (0x88, 0x100, 0x148, 0x210, 0x80, 0x84, 0x104, 0x124, 0x16c, 0x13c, 0x800, 0x808, 0x82c, 0x130, 0x140, 0x144, 0x21c, 0x834, 0x83c). Please give each register a named #define (reuse the existing PORT_*/CORE_* names in pcie-apple.c where they exist), build each value from named fields, and say in a comment where each value comes from. Do the same for the BIT(9) and BIT(10) set on port->phy after RADIO_PHY_RESET. Where the probe path already programs a register, call that code instead of repeating the value.

  2. apple_radio_recover() compares against { 0x443414e4, 0x5f7214e4 }. Use PCI_VENDOR_ID_BROADCOM and named device IDs (0x4434, 0x5f72) instead.

  3. The CLKREQ/PERST pin check requires the pinctrl to be at 0x39a000000ULL. The apple,t8132-pinctrl compatible check and the phandle arguments are enough; please drop the hardcoded physical address.

  4. apple_radio_terminal() calls panic() and is reached from apple_msi_domain_free() while the writer gate is closed. As in #1378, please fail closed with a WARN and an error state instead of panicking.

  5. pcie-apple.c does #include "pcie-apple-radio.c". Please build it as its own object.

  6. The pcie-apple.c changes to MSI allocation and free, and to apple_pcie_enable_device(), run on every Apple PCIe host, not only J713. The description only covers J713. Please add a boot and Wi-Fi/Bluetooth check on at least one other SoC (T8103/T8112/T600x) showing they are unaffected.

  7. CI has not run on this head.

This can land only after #1314, #1378 and #1381.

@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