Skip to content

Bluetooth: hci_bcm4377: handle function resets through the PCI core - #590

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
claude/bootlog-bcm4377-reset-handlers
Oct 30, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
claude/bootlog-bcm4377-reset-handlers

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Every boot of the M1 Pro, the M2 and the J616s logs two PCI warnings from the Bluetooth probe:

hci_bcm4377 0000:01:00.1: resetting
hci_bcm4377 0000:01:00.1: reset done

Probe resets the function with pci_reset_function_locked() while the driver is bound, and the driver has no reset_prepare/reset_done handler, which the PCI core has warned about since a3151e6 ("PCI: Warn if a running device is unaware of reset"). The warning is right in general: a reset from the PCI core or sysfs while the controller runs loses its firmware and rings and the driver would only notice through command timeouts.

This adds the handlers:

  • Probe resets before it sets the driver data, so nothing to do.
  • bcm4377_pci_reset() already quiesces and restarts the controller around its own reset (marked with a new own_reset flag), so nothing to do.
  • Any other reset keeps the interrupt off while it runs, then rebinds the driver, the same recovery the driver uses after a command timeout. That code moves into bcm4377_queue_rebind() so both share it; the high-window radio keeps its "requires a platform reboot" refusal.

Testing

  • W=1 compile of the touched objects with the universal config (Fedora Asahi base + asahi.config), no new warnings; full Image, modules and dtbs build of all four bootlog PRs together is queued on the buildbox. checkpatch clean apart from the Co-Authored-By trailer.
  • Not yet run on hardware. To test on the M1 Pro or the M2: boot and check that dmesg has no resetting/reset done pair and Bluetooth comes up (bluetoothctl show). Optional: echo 1 > /sys/bus/pci/devices/0000:01:00.1/reset should log "function reset, rebinding the driver" and Bluetooth should come back.

🤖 Generated with Claude Code

Probe resets the function with pci_reset_function_locked() while the
driver is bound. The driver has no reset_prepare or reset_done handler,
so since commit a3151e6 ("PCI: Warn if a running device is unaware
of reset") every boot logs

  hci_bcm4377 0000:01:00.1: resetting
  hci_bcm4377 0000:01:00.1: reset done

on the M1 Pro, the M2 and the M4 Pro. The warning has a point: a reset
from the PCI core or from sysfs while the controller runs loses its
firmware and rings, and nothing in the driver notices until commands
time out.

Add the handlers. Probe resets before it sets the driver data, and
bcm4377_pci_reset() already quiesces and restarts the controller around
its own reset, so both are left alone. Any other reset keeps the
interrupt off while it runs and then rebinds the driver, the recovery
the driver already uses after a command timeout; that path moves into
bcm4377_queue_rebind() so both callers share it.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Full universal-config build (Fedora Asahi base + asahi.config, LLVM, W=1) of aurora-wip b7edb5b plus #587, #588, #589 and #590 together: Image, modules and dtbs build OK, no warnings or errors in the touched files. Not yet run on hardware.

@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.

  • M2 and M1 Pro: the hci_bcm4377 ... resetting / reset done pair (2 lines per boot on fleet9) is gone, Bluetooth powered on every boot.
  • Optional reset on the M1 Pro: echo 1 > /sys/bus/pci/devices/0000:01:00.1/reset logged function reset, rebinding the driver and Bluetooth was back (powered) within 3 s. The old instance's teardown also logged failed to destroy transfer ring 6 and transport needs hardware reset on next open, which is expected after the controller lost its rings; worth knowing if anyone counts err lines after a manual reset.
  • J616s not tested yet.

@RyanTheTide
RyanTheTide merged commit 99946d9 into aurora-wip Oct 30, 2026
@RyanTheTide
RyanTheTide deleted the claude/bootlog-bcm4377-reset-handlers branch October 30, 2026 06:11
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