From: Raymond Berger <ray.berger@archive.org>
To: dev@deq.rocks
Cc: Sven Peter <sven@kernel.org>,
Marcel Holtmann <marcel@holtmann.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
Janne Grunau <j@jannau.net>, Neal Gompa <neal@gompa.dev>,
asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] Bluetooth: hci_bcm4377: keep ASPM off only while the firmware boots
Date: Sun, 29 Nov 2026 19:25:06 -0800 [thread overview]
Message-ID: <20261130032506.27039-1-ray.berger@archive.org> (raw)
In-Reply-To: <20261127132501.262651-4-dev@deq.rocks>
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@archive.org>
I used Claude Opus 5.5 to help run these tests. It spotted this issue
while going through the code.
prev parent reply other threads:[~2026-11-30 3:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 13:24 [PATCH v3 0/3] Bluetooth: hci_bcm4377: resume after ACPI S3 and ASPM Andre Eikmeyer
2026-11-27 13:24 ` [PATCH v3 1/3] Bluetooth: hci_bcm4377: check hci_register_dev() for a negative return Andre Eikmeyer
2026-11-30 3:17 ` Raymond Berger
2026-11-27 13:25 ` [PATCH v3 2/3] Bluetooth: hci_bcm4377: probe again after a resume through firmware Andre Eikmeyer
2026-11-30 3:20 ` Raymond Berger
2026-11-27 13:25 ` [PATCH v3 3/3] Bluetooth: hci_bcm4377: keep ASPM off only while the firmware boots Andre Eikmeyer
2026-11-30 3:25 ` Raymond Berger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130032506.27039-1-ray.berger@archive.org \
--to=ray.berger@archive.org \
--cc=asahi@lists.linux.dev \
--cc=dev@deq.rocks \
--cc=j@jannau.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=neal@gompa.dev \
--cc=sven@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®