diff mbox series

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

Message ID bug-217651-62941-Hk3dwMQ6SC@https.bugzilla.kernel.org/ (mailing list archive)
State Superseded
Headers show
Series [Bug,217651] BCM20702B0 Bluetooth device in MacBook no longer working | expand

Checks

Context Check Description
tedd_an/pre-ci_am fail 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

Commit Message

bugzilla-daemon@kernel.org July 12, 2023, 10:59 p.m. UTC
https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #14 from johnbholland@icloud.com ---
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:

( - 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,
 Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Comments

bluez.test.bot@gmail.com July 12, 2023, 11:13 p.m. UTC | #1
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
diff mbox series

Patch

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 5c536151ef83..4ca91c033d2f 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -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;