Skip to content

[5/5] Bluetooth: bcm4377: Restore private PCI windows before J713 resume - #1384

Closed
erikwb wants to merge 1 commit into
j713/radio-s2r-wififrom
j713/radio-s2r-bluetooth
Closed

erikwb wants to merge 1 commit into
j713/radio-s2r-wififrom
j713/radio-s2r-bluetooth

Conversation

@erikwb

@erikwb erikwb commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

After shared radio PERST, Wi-Fi can recover while Bluetooth HCI commands time out: private PCI window configuration is lost and is not covered by generic PCI saved state. Restore bcm4377_init_cfg and subsystem control in resume_noirq, before interrupts or UNQUIESCE use the retained controller.

Coordinate QUIESCE and recovery work with the managed host transaction. The tested path retains Bluetooth firmware and needs no reload or additional RTI handshake. Include fault-injection coverage for configuration failures and retained-path skips.

Part 5/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 #1383.

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.

Shared radio PERST resets private BAR windows that generic PCI saved
state does not cover. Restore the windows and subsystem control in
resume_noirq, before interrupts or UNQUIESCE access the retained device.
Without this, Wi-Fi returns after sleep but Bluetooth HCI commands time
out. Restoring the windows permits Read Local Version to complete.

Coordinate QUIESCE and recovery work with the managed host transaction,
leaving other controllers on their existing path. Cover config failures
and retained-path skips with a fault-injection fixture.

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.

The new resume_noirq restore and the QUIESCE changes are gated on apple_radio_sleep_owned() (and pm_resume_via_firmware()), so other hosts keep the existing path.

Remaining items:

  1. bcm4377_suspend() now returns -EBUSY for an owned device with wakeup enabled, which refuses the whole sleep whenever Bluetooth wake is on. Please document that in the commit message and log it once (dev_info), or make the wake source part of the supported case.

  2. Switching from DEFINE_SIMPLE_DEV_PM_OPS to a full dev_pm_ops changes the ops on every bcm4377 host. Please add a suspend/resume run on one non-J713 machine.

  3. CI has not run on this head.

This can land only after the rest of the series (#1314 through #1383).

@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