Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Bluetooth: hci_bcm4377: resume after ACPI S3 and ASPM
@ 2026-11-27 13:24 Andre Eikmeyer
  2026-11-27 13:24 ` [PATCH v3 1/3] Bluetooth: hci_bcm4377: check hci_register_dev() for a negative return Andre Eikmeyer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andre Eikmeyer @ 2026-11-27 13:24 UTC (permalink / raw)
  To: sven, marcel, luiz.dentz
  Cc: j, neal, asahi, linux-arm-kernel, linux-bluetooth, linux-kernel,
	Andre Eikmeyer

After ACPI S3 the Bluetooth function of the BCM4377 comes back without
its firmware. Patch 2 probes it again after such a resume.

When the previous controller is still being released, the re-probe
registers the new one under another index, which runs into the probe
return check fixed in patch 1. Patch 1 is a fix on its own and goes
first.

Because of a hardware erratum the driver keeps ASPM disabled on the
whole link to the Wi-Fi and Bluetooth chip for as long as it is bound,
which holds the CPU package at PC3. Patch 3 disables ASPM only while
the firmware boots and restores it once the firmware runs, also after
the re-probe from patch 2.

The Wi-Fi function of the same chip needs the same after S3 and goes to
linux-wireless in "wifi: brcmfmac: pcie: S3 suspend and resume on the
T2 Mac chips".

Tested on MacBookAir9,1 and MacBookPro15,4.

Changes in v3:
- Rebase on bluetooth-next
- Patch 1: shorter subject, add Sven's Reviewed-by from v1
- Patch 3: add Sven's Acked-by

Changes in v2:
- Add patch 3, keep ASPM off only while the firmware boots
- Patches 1 and 2 are unchanged

v2: https://lore.kernel.org/all/20261111120248.21062-1-dev@deq.rocks/
v1: https://lore.kernel.org/all/20261107154839.89941-1-dev@deq.rocks/

Andre Eikmeyer (3):
  Bluetooth: hci_bcm4377: check hci_register_dev() for a negative return
  Bluetooth: hci_bcm4377: probe again after a resume through firmware
  Bluetooth: hci_bcm4377: keep ASPM off only while the firmware boots

 drivers/bluetooth/hci_bcm4377.c | 93 +++++++++++++++++++++++++++++----
 1 file changed, 83 insertions(+), 10 deletions(-)


base-commit: f57f78086ab54f3b3122fbaeba2c842ba7bb6d00

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH v2 1/3] Bluetooth: hci_bcm4377: treat only negative hci_register_dev() returns as errors
@ 2026-11-11 12:02 Andre Eikmeyer
  2026-11-11 18:22 ` Bluetooth: hci_bcm4377: resume after ACPI S3 and ASPM bluez.test.bot
  0 siblings, 1 reply; 6+ messages in thread
From: Andre Eikmeyer @ 2026-11-11 12:02 UTC (permalink / raw)
  To: sven, marcel, luiz.dentz
  Cc: j, neal, asahi, linux-arm-kernel, linux-bluetooth, linux-kernel,
	Andre Eikmeyer

If another controller already holds hci0, a USB Bluetooth dongle for
example, the BCM4377 is registered as hci1 and probe returns 1. The PCI
core takes that as success, but the devm action that unregisters the
controller is never added, so it stays registered after unbind while
its driver data is freed.

hci_register_dev() returns the index of the new controller on success.
Check for a negative return, as the other drivers do.

Fixes: 8a06127602de ("Bluetooth: hci_bcm4377: Add new driver for BCM4377 PCIe boards")
Signed-off-by: Andre Eikmeyer <dev@deq.rocks>
---
 drivers/bluetooth/hci_bcm4377.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_bcm4377.c b/drivers/bluetooth/hci_bcm4377.c
index 66d49b47154..da0a48c2be3 100644
--- a/drivers/bluetooth/hci_bcm4377.c
+++ b/drivers/bluetooth/hci_bcm4377.c
@@ -2410,7 +2410,7 @@ static int bcm4377_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		return ret;
 
 	ret = hci_register_dev(hdev);
-	if (ret)
+	if (ret < 0)
 		return ret;
 	return devm_add_action_or_reset(&pdev->dev, bcm4377_hci_unregister_dev,
 					hdev);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-27 22:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-27 22:42   ` Bluetooth: hci_bcm4377: resume after ACPI S3 and ASPM bluez.test.bot
2026-11-27 13:25 ` [PATCH v3 2/3] Bluetooth: hci_bcm4377: probe again after a resume through firmware Andre Eikmeyer
2026-11-27 13:25 ` [PATCH v3 3/3] Bluetooth: hci_bcm4377: keep ASPM off only while the firmware boots Andre Eikmeyer
  -- strict thread matches above, loose matches on Subject: below --
2026-11-11 12:02 [PATCH v2 1/3] Bluetooth: hci_bcm4377: treat only negative hci_register_dev() returns as errors Andre Eikmeyer
2026-11-11 18:22 ` Bluetooth: hci_bcm4377: resume after ACPI S3 and ASPM bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox