Re: [PATCH v3 3/3] Bluetooth: hci_bcm4377: keep ASPM off only while the firmware boots
From: Raymond Berger
Date: Sun Nov 29 2026 - 22:26:18 EST
On Fri, Nov 27, 2026 at 02:25:01PM +0100, Andre Eikmeyer wrote:
> static void bcm4377_disable_aspm(struct bcm4377_data *bcm4377)
> {
[...]
> + pcie_capability_read_word(bcm4377->pdev, PCI_EXP_LNKCTL,
> + &bcm4377->link_ctl);
> pcie_capability_clear_word(bcm4377->pdev, PCI_EXP_LNKCTL,
> PCI_EXP_LNKCTL_ASPMC);
> }
[...]
> @@ -2425,6 +2436,9 @@ static int bcm4377_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> if (ret)
> return ret;
>
> + if (bcm4377->hw->disable_aspm)
> + bcm4377_restore_aspm(bcm4377);
> +
I think ASPM can end up off for good when a probe fails between these
two. Any error return between bcm4377_disable_aspm() and
bcm4377_restore_aspm() (enabling the device, BAR mapping, OTP read,
IRQ setup, firmware boot, RTI setup) leaves ASPM cleared in LNKCTL.
The next probe, after a rebind or a reload, saves that cleared value
and later "restores" it, so ASPM stays off until reboot. Restoring the
saved value on the error paths, for example with a devm action
registered right after bcm4377_disable_aspm(), would avoid that. I
haven't written or tested such a change.
Failed probes do happen on this MacBookAir9,1. With all three patches,
Bluetooth hung during setup on most boots, and on the rebinds that
followed, probes often failed with -110 (firmware boot timeout) before
one succeeded. On those boots lspci showed ASPM disabled on the
Bluetooth function afterwards; after a clean probe it shows L1
enabled. The timeouts themselves came from outside this series:
brcmfmac's probe reset the whole chip while hci_bcm4377 was still
starting, because my distribution loads hci_bcm4377 first. Loading it
after Wi-Fi is up fixed that (50 of 50 clean boots, 10 of them with
all three patches).
ASPM on the Bluetooth function is what moves the package C-state here.
Idle, with its ASPM bits cleared by hand (setpci) and then restored to
what 3/3 leaves, each pair measured back to back in one boot:
AC, screen on: PC3 28%, 2.49 W -> PC6 22%, 1.97 W (package)
AC, screen off: PC3 55%, 1.51 W -> PC6 54%, 0.90 W (package)
battery, screen off: PC3 54%, 1.45 W -> PC6 53%, 0.93 W (package)
3.35 W -> 2.67 W (whole system, discharge)
Your commit message says this model reaches PC8; here it stops at PC6
(PC7 to PC10 stayed at 0 where I logged them). Did your PC8 run
include other changes?
With ASPM actually on (after a clean probe; in my earlier runs failed
probes had left it off), resumes with all three patches were fine
apart from the rtcwake one in my 2/3 reply: 7 of 7 with Bluetooth
unbound around suspend from userspace (ASPM on again after each), and
8 of 8 that went through the re-probe from 2/3, alternating ASPM on
and off before suspend. That's too few to rule ASPM out, but it
doesn't seem to trigger that failure by itself.
Tested-by: Raymond Berger <ray.berger@xxxxxxxxxxx>
I used Claude Opus 5.5 to help run these tests. It spotted this issue
while going through the code.