Skip to contentSkip to conversation

New: BCM20702B0 Bluetooth device in MacBook no longer working

Bug 217651 [email protected] 2 participants 26 messages Jul 9, 2023 – Aug 28, 2023 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=217651

            Bug ID: 217651
           Summary: BCM20702B0  Bluetooth device in MacBook no longer
                    working
           Product: Drivers
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Bluetooth
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

BCM20702B0 Bluetooth device on intel MacBook from 2014 not found by kernel 6.4.2.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#2 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

Bagas Sanjaya ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Bagas Sanjaya ([email protected]) ---
Can you attach lspci and dmesg? Can you also perform bisection to find the culprit commit (see Documentation/admin-guide/bug-bisect.rst for details)? You'll most likely need to compile your own kernel anyway, so read Documentation/admin-guide/quickly-build-trimmed-linux.rst for the instructions.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#3 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #3 from [email protected] ---
Created attachment 304584
--> https://bugzilla.kernel.org/attachment.cgi?id=304584&action=edit
lspci from arch kernel 6.3.9

this is the latest 6.3.9 kernel in the arch archive, and bluetooth works with it

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#4 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #4 from [email protected] ---
Created attachment 304585
--> https://bugzilla.kernel.org/attachment.cgi?id=304585&action=edit
dmesg from arch kernel 6.3.9

this is the latest 6.3.9 kernel in the arch archive, and bluetooth works with it

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#5 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #5 from [email protected] ---
Created attachment 304586
--> https://bugzilla.kernel.org/attachment.cgi?id=304586&action=edit
lspci from arch kernel 6.4.1

this is the first 6.4.1 kernel in the arch archive, and bluetooth doesn't work with it

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#6 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #6 from [email protected] ---
Created attachment 304587
--> https://bugzilla.kernel.org/attachment.cgi?id=304587&action=edit
dmesg from arch kernel 6.4.1

this is the first 6.4.1 kernel in the arch archive, and bluetooth doesn't work with it

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#7 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #7 from [email protected] --- Comment on attachment 304586
--> https://bugzilla.kernel.org/attachment.cgi?id=304586
lspci from arch kernel 6.4.1

this is the first 6.4.1 kernel in the arch archive, and bluetooth doesn't work with it

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#8 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #8 from [email protected] ---
(In reply to Bagas Sanjaya from comment #2)

Quoted 5 lines

Can you attach lspci and dmesg? Can you also perform bisection to find the culprit commit (see Documentation/admin-guide/bug-bisect.rst for details)? You'll most likely need to compile your own kernel anyway, so read Documentation/admin-guide/quickly-build-trimmed-linux.rst for the instructions.

Hi,
I installed 6.3.9 and 6.4.1 kernels from arch archive and found that 6.3.9 produces working bluetooth and 6.4.1 does not. I will look into building and running from mainline but that may be beyond my skills.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#9 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #9 from [email protected] ---
(In reply to Bagas Sanjaya from comment #2)

Quoted 5 lines

Can you attach lspci and dmesg? Can you also perform bisection to find the culprit commit (see Documentation/admin-guide/bug-bisect.rst for details)? You'll most likely need to compile your own kernel anyway, so read Documentation/admin-guide/quickly-build-trimmed-linux.rst for the instructions.

working and non-working lspci and dmesg output is attached.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#10 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #10 from [email protected] ---
Since I recently retired, I have some time to put into this. I have built 6.3.12 and 6.4.0-rc1 from kernel.org sources and tested, the 6.3.12 works and the 6.4.0-rc1 does not (in terms of the bluetooth issue). Looking at the git log of 6.4.0 there was a lot of bluetooth related activity. I've chosen a commit from before that and am trying to build that and test it. If it boots and the bluetooth works, I guess 6.4.0-rc1 and that starting point could be initial points to use in bisecting? This is somewhat new territory for me but so far it's been pretty straightforward.  The kernel builds take a long time on this macbook pro from 2014.

Quoted 15 lines · On 7/9/23 23:33, [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=217651

Bagas Sanjaya ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Bagas Sanjaya ([email protected]) --- Can you attach lspci and dmesg? Can you also perform bisection to find the culprit commit (see Documentation/admin-guide/bug-bisect.rst for details)? You'll most likely need to compile your own kernel anyway, so read Documentation/admin-guide/quickly-build-trimmed-linux.rst for the instructions.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#11 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #11 from Bagas Sanjaya ([email protected]) ---

Quoted 9 lines · John Holland

Since I recently retired, I have some time to put into this. I have built 6.3.12 and 6.4.0-rc1 from kernel.org sources and tested, the 6.3.12 works and the 6.4.0-rc1 does not (in terms of the bluetooth issue). Looking at the git log of 6.4.0 there was a lot of bluetooth related activity. I've chosen a commit from before that and am trying to build that and test it. If it boots and the bluetooth works, I guess 6.4.0-rc1 and that starting point could be initial points to use in bisecting? This is somewhat new territory for me but so far it's been pretty straightforward.  The kernel builds take a long time on this macbook pro from 2014.

tl;dr:

Quoted 11 lines

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

Please see Documentation/admin-guide/quickly-build-trimmed-linux.rst for how to quickly compile your own kernel.

Bye!

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#12 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

The Linux kernel's regression tracker (Thorsten Leemhuis) ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #12 from The Linux kernel's regression tracker (Thorsten Leemhuis) ([email protected]) --- (In reply to johnbholland from comment #10)

Quoted 4 lines

I've chosen a commit from before that and am trying to build that and test it. If it boots and the bluetooth works, I guess 6.4.0-rc1 and that starting point could be initial points to use in bisecting?

Thanks for trying to find the cause, that helpful and simply needed in cases like this. You might want to bisect between 6.3 and 6.4, as maybe it's some change outside of bluetooth that broke things (but it's possible that you are on the right track, too).

Side notes:
* might be worth giving 6.5-rc1 a try, with a bit of luck it might contain a fix (but there is a decent chance we are unlucky).
* cross-compiling might help to speed things up.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#13 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #13 from [email protected] ---

Quoted 9 lines

Thanks for trying to find the cause, that helpful and simply needed in cases like this. You might want to bisect between 6.3 and 6.4, as maybe it's some change outside of bluetooth that broke things (but it's possible that you are on the right track, too).

Side notes:
* might be worth giving 6.5-rc1 a try, with a bit of luck it might contain a fix (but there is a decent chance we are unlucky).
* cross-compiling might help to speed things up.

You're welcome. This is a new experience for me. It's pretty mechanical at this point, it just takes a while for each kernel rebuild. I hope at the end of it to have some useful information.I may be doing this off and on for a couple days :) . I'm getting much more comfortable with the steps to make my system boot with a new kernel.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#14 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #14 from [email protected] ---
I believe I have identified the problem and a fix. Commit c13380a55522bf14e54779a142487c224509db95 is the cause, found by bisecting and testing. Without it (built from immediately prior commit) the problem goes away. Also, in the current code, this change is there and the latest version 6.5.0-rc1 has the issue, and it can be fixed by reverting this change. The change in question is:

drivers/bluetooth/btusb.c +3 -7
index 5c536151ef83..4ca91c033d2f 100644
@@ -3831,13 +3831,9 @@ static int btusb_probe(struct usb_interface *intf,
 
        BT_DBG("intf %p id %p", intf, id);
 
-       /* interface numbers are hardcoded in the spec */
-       if (intf->cur_altsetting->desc.bInterfaceNumber != 0) {
-               if (!(id->driver_info & BTUSB_IFNUM_2))
-                       return -ENODEV;
-               if (intf->cur_altsetting->desc.bInterfaceNumber != 2)
-                       return -ENODEV;
-       }
+       if ((id->driver_info & BTUSB_IFNUM_2) &&
+           (intf->cur_altsetting->desc.bInterfaceNumber != 2))
+               return -ENODEV;
 
        ifnum_base = intf->cur_altsetting->desc.bInterfaceNumber;
 

( - is the code that works, + is the code that doesn't).
Looking at the code, it looks like it was meant to remove the outer if statement and turn the inner part into something simpler. I think it is missing an ! and uses && instead of || if that is what it intends.

When I changed it to that though, the problem still existed. So what worked for me was to revert this block of code to the previous version, in both 6.3 and 6.5. In 6.5 this file has changed a lot, but this block is the same as the commit made it.

My 2014 Macbook Pro is perhaps an obscure bit of hardware and I don't know whether this change was fixing something on other hardware. On my Macbook, though, it causes the internal Bluetooth controller to not be seen. I will also send an email to the people in the commit,

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#15 lore raw

RE: [Bug,217651] BCM20702B0 Bluetooth device in MacBook no longer working

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----

error: patch failed: drivers/bluetooth/btusb.c:3831
error: drivers/bluetooth/btusb.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch

Please resolve the issue and submit the patches again.

---
Regards,
Linux Bluetooth

#16 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

Paul Menzel ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |pmenzel+bugzilla.kernel.org
                   |                            |@molgen.mpg.de

--- Comment #15 from Paul Menzel ([email protected]) --- John sent a notification to the mailing list, so I am adding the back link:
https://lore.kernel.org/linux-bluetooth/[email protected]/T/#t

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#17 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

Tomasz Moń ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #16 from Tomasz Moń ([email protected]) --- Could you please attach "lsusb -d 05ac: -v" output?

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#18 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #17 from Tomasz Moń ([email protected]) ---
I think I understand the issue now, but the lsusb output would confirm it. Before my patch, the driver would allow both interface 0 and 2, after it only interface 2 is allowed for devices with BTUSB_IFNUM_2 flag set.

I see two potential solutions:
1. Remove the check completely
2. Change the if condition to allow both interface 0 and 2.

For the second solution, please try following patch:

drivers/bluetooth/btusb.c +2 -1
index 5ec4ad0a5c86..46844194f54e 100644
@@ -4104,7 +4104,8 @@ static int btusb_probe(struct usb_interface *intf,
        BT_DBG("intf %p id %p", intf, id);
 
        if ((id->driver_info & BTUSB_IFNUM_2) &&
-           (intf->cur_altsetting->desc.bInterfaceNumber != 2))
+           ((intf->cur_altsetting->desc.bInterfaceNumber != 0) ||
+            (intf->cur_altsetting->desc.bInterfaceNumber != 2))
                return -ENODEV;
 
        ifnum_base = intf->cur_altsetting->desc.bInterfaceNumber;
Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#20 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #18 from Tomasz Moń ([email protected]) ---
The previous proposal is bogus as I messed up the conditions again. It would reject anything with BTUSB_IFNUM_2 when the interface is either 0 or 2. What we want is to allow either 0 or 2 when BTUSB_IFNUM_2 is set.

The correct patch to try would be:

drivers/bluetooth/btusb.c +1 -0
index 5ec4ad0a5c86..764d176e9735 100644
@@ -4104,6 +4104,7 @@ static int btusb_probe(struct usb_interface *intf,
        BT_DBG("intf %p id %p", intf, id);
 
        if ((id->driver_info & BTUSB_IFNUM_2) &&
+           (intf->cur_altsetting->desc.bInterfaceNumber != 0) &&
            (intf->cur_altsetting->desc.bInterfaceNumber != 2))
                return -ENODEV;
 
Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#19 lore raw

RE: [Bug,217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----

error: patch failed: drivers/bluetooth/btusb.c:4104
error: drivers/bluetooth/btusb.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch

Please resolve the issue and submit the patches again.

---
Regards,
Linux Bluetooth

#21 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

Nick Bates ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #19 from Nick Bates ([email protected]) ---
I also have a problem with bluetooth, also on ArchLinux, but on a Dell Latitude E7240. I'll try with the kernel versions mentioned above, and also try Tomasz's patch, in the next few days (urgent tasks first ...).

Bear in mind, I still see the bluetooth controller, but bluetoothd either crashes or exhibits strange behaviour when my Plantronics BackBeat GO 600 headphones connect.

Does anyone want to see my lspci/journalctl output?

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#22 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #20 from Paul Menzel ([email protected]) --- Nick, thank you for the report, but please create a new issue with all the information like all logs, what devices work and what do not and if it’s a regression.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#23 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #21 from [email protected] --- Hi,
the following code is working on my 2014 Intel Macbook Pro -

Thanks for the good work!

drivers/bluetooth/btusb.c +5 -3
index 5ec4ad0a5c86..596dc69ce510 100644
@@ -4103,9 +4103,11 @@ static int btusb_probe(struct usb_interface *intf,
 
        BT_DBG("intf %p id %p", intf, id);
 
-       if ((id->driver_info & BTUSB_IFNUM_2) &&
-           (intf->cur_altsetting->desc.bInterfaceNumber != 2))
-               return -ENODEV;
+
+               if ((id->driver_info & BTUSB_IFNUM_2) &&
+           (intf->cur_altsetting->desc.bInterfaceNumber != 0) &&
+           (intf->cur_altsetting->desc.bInterfaceNumber != 2))
+               return -ENODEV;
 
        ifnum_base = intf->cur_altsetting->desc.bInterfaceNumber;
 
Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.
#24 lore raw

RE: [Bug,217651] BCM20702B0 Bluetooth device in MacBook no longer working

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----

error: patch failed: drivers/bluetooth/btusb.c:4103
error: drivers/bluetooth/btusb.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch

Please resolve the issue and submit the patches again.

---
Regards,
Linux Bluetooth

#25 lore raw

[Bug 217651] BCM20702B0 Bluetooth device in MacBook no longer working

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=217651

[email protected] changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #22 from [email protected] ---
I can also confirm it's now working on my 2017 Intel Macbook Air. Thank you all for testing & fixing this so quickly.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.