Skip to content

Bluetooth: bcm4377: abort suspend if wake IRQ arming fails - #600

Merged
RyanTheTide merged 1 commit into
integration/aurorafrom
conv/bcm4377-wake-arm
Oct 30, 2026
Merged

RyanTheTide merged 1 commit into
integration/aurorafrom
conv/bcm4377-wake-arm

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

This carries d808471 from aurora-wip onto integration/aurora. It is part of the convergence of the two kernel lines: once this and the other ready topics land here, aurora-wip has nothing left that integration/aurora lacks.

With controller wake enabled, bcm4377_suspend() returned success even when enable_irq_wake() failed. The MSI was then not a wake source, although HCI had been suspended for remote wake. The suspend now fails with the arming error and undoes the HCI suspend through the existing resume path. The PM core never calls resume for a device whose suspend failed, so the rollback has to happen here. The IRQ is armed before the PCI state is saved, so an aborted suspend leaves no saved-state marker.

Testing

  • The commit picks cleanly onto 695d974. The build of the convergence stack (this and the other four convergence PRs on 695d974, shipping recipe: Fedora Asahi base + asahi.config + olddefconfig) is queued on the buildbox. I will add the result here as a comment.
  • Host model tests from the original commit cover arming failure, rollback failure, repeated wake cycles, wake disabled and HCI suspend failure.
  • Not yet booted. It needs a boot plus s2idle cycles with Bluetooth wake enabled and disabled on the M1 Pro or the M2 (BCM4387/4378 on hci_bcm4377) before it merges here. Neither the Neo nor the J616s use this driver.

🤖 Generated with Claude Code

With controller wake enabled, bcm4377_suspend() returns success even
when enable_irq_wake() fails. The MSI is then not a wake source, although
HCI has been suspended for remote wake and the function remains in D0.
A fault-injected callback test reproduces a zero return with HCI still
suspended and no wake reference after enable_irq_wake() returns -ENXIO.

Return the arming error and undo HCI suspension using the existing resume
path. Clear the powered-resume epoch before that rollback, since no
system sleep completed, and preserve the original error if HCI rollback
also fails. Arm the IRQ before saving PCI state, so an aborted suspend
does not leave a saved-state marker. The PM core does not invoke resume
for the device whose suspend callback failed.

The extracted PM callbacks pass host tests with mocked kernel APIs for
arming failure, rollback failure, repeated successful wake cycles,
wake-disabled quiescence and HCI suspend failure, with recovery support
on and off. ARM64 kernel build and hardware wake qualification remain
pending; this does not establish the cause of a particular machine hang.

Fixes: 0609ca7 ("Bluetooth: hci_bcm4377: Support remote wakeup")
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
(cherry picked from commit d808471)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

The convergence stack build is still waiting for a buildbox slot, because every slot is busy with other builds. It is buildbox /srv/aurora/fast/o/conv-20261030/conv-build-stack.sh on branch conv/stack (all five convergence commits on 695d974). The result goes to stack-run.log in that directory, ending with BUILD-RC <n>. Do not merge this before that shows 0 and the boot test in the description has passed.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

The stack build passed: BUILD-RC 0. It built branch conv/stack at 1ab07a86a030, which is all five convergence commits (#600 to #604) on integration/aurora 695d974. The config is the shipping recipe (Fedora Asahi base + asahi.config + olddefconfig) plus CONFIG_DRM_ASAHI_G15=y, so the G15 adapter in #602 was compiled too. It built Image, modules and dtbs as 7.3.0-aurora-conv, with clang/LLVM and the corrected bindgen 0.73.2. None of the touched files (apple-sio, hci_bcm4377, drm/asahi workqueue/g15) gave a warning. The only warning in the whole build is the existing unused MM static in drivers/gpu/drm/asahi/memacct.rs, which none of these commits touch. The SIO KUnit cases were not run, because they need APPLE_SIO=y and the shipping recipe builds SIO as a module. What is still needed before merging is the boot test in the description.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Boot-tested in fleet10 (7.3.0-aurora-fleet10): integration/aurora 1173b79 plus 587, 588, 589, 590, 596, 599, 600, 601, 603, 604, 605, 607 and 608, built with the shipping recipe (Fedora Asahi base + asahi.config, 0 mismatches, all distro gates). apple-dcp host selftests 80/80, and the other host tests match integration/aurora exactly (62 pass, the same 26 pre-existing failures). One-shot boots on the Neo (J700), the M2 and the M1 Pro, compared with each machine's fleet9 boot; fleet10 is now the default on all three. Full dmesg and journals are in aurora-ctl reports/fleet10-20261030.

Result for this PR: pass on the M1 Pro.

  • Two pm_test=devices s2idle cycles with /sys/bus/pci/devices/0000:01:00.1/power/wakeup enabled and then disabled: both suspended and resumed devices cleanly (suspend 0.75 s, resume 0.80 s), Bluetooth powered after each, wakeup set back to disabled.
  • That runs the driver's suspend and resume callbacks, including the wake IRQ arming, but not a full sleep. The arming failure path itself was not hit (arming succeeded), which is the normal case.
  • Normal boots on the M2 and the M1 Pro: Bluetooth up, no hci_bcm4377 errors.

@RyanTheTide
RyanTheTide merged commit 0b79795 into integration/aurora Oct 30, 2026
@RyanTheTide
RyanTheTide deleted the conv/bcm4377-wake-arm branch October 30, 2026 05:50
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.

1 participant