2023-07-13 10:52:22

by Tomasz Moń

[permalink] [raw]
Subject: [RFC PATCH] Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014

Commit c13380a55522 ("Bluetooth: btusb: Do not require hardcoded
interface numbers") inadvertedly broke bluetooth on Intel Macbook 2014.
The intention was to keep behavior intact when BTUSB_IFNUM_2 is set and
otherwise allow any interface numbers. The problem is that the new logic
condition omits the case where bInterfaceNumber is 0.

Fix BTUSB_IFNUM_2 handling by allowing both interface number 0 and 2
when the flag is set.

Fixes: c13380a55522 ("Bluetooth: btusb: Do not require hardcoded interface numbers")
Reported-by: John Holland <[email protected]>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217651
Signed-off-by: Tomasz Moń <[email protected]>
---
drivers/bluetooth/btusb.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index d844fb8e7cb7..ab7d62538b48 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -4258,6 +4258,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;

--
2.41.0



2023-07-13 11:07:36

by bluez.test.bot

[permalink] [raw]
Subject: RE: [RFC] Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=765251

---Test result---

Test Summary:
CheckPatch PASS 0.56 seconds
GitLint PASS 0.24 seconds
SubjectPrefix PASS 0.07 seconds
BuildKernel PASS 33.17 seconds
CheckAllWarning PASS 36.45 seconds
CheckSparse PASS 42.01 seconds
CheckSmatch PASS 112.99 seconds
BuildKernel32 PASS 32.31 seconds
TestRunnerSetup PASS 490.59 seconds
TestRunner_l2cap-tester PASS 23.36 seconds
TestRunner_iso-tester PASS 42.54 seconds
TestRunner_bnep-tester PASS 10.79 seconds
TestRunner_mgmt-tester PASS 219.78 seconds
TestRunner_rfcomm-tester PASS 15.99 seconds
TestRunner_sco-tester PASS 17.07 seconds
TestRunner_ioctl-tester PASS 18.41 seconds
TestRunner_mesh-tester PASS 13.44 seconds
TestRunner_smp-tester PASS 14.46 seconds
TestRunner_userchan-tester PASS 11.18 seconds
IncrementalBuild PASS 30.40 seconds



---
Regards,
Linux Bluetooth

2023-07-13 12:13:17

by John Holland

[permalink] [raw]
Subject: Re: [RFC PATCH] Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014


> Commit c13380a55522 ("Bluetooth: btusb: Do not require hardcoded
> interface numbers") inadvertedly broke bluetooth on Intel Macbook 2014.
> The intention was to keep behavior intact when BTUSB_IFNUM_2 is set and
> otherwise allow any interface numbers. The problem is that the new logic
> condition omits the case where bInterfaceNumber is 0.
>
> Fix BTUSB_IFNUM_2 handling by allowing both interface number 0 and 2
> when the flag is set.
>
> Fixes: c13380a55522 ("Bluetooth: btusb: Do not require hardcoded interface numbers")
> Reported-by: John Holland <[email protected]>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217651
> Signed-off-by: Tomasz Moń <[email protected]>
> ---
> drivers/bluetooth/btusb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index d844fb8e7cb7..ab7d62538b48 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -4258,6 +4258,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;
>

Tested-by: John Holland<[email protected]>


2023-07-13 20:14:06

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [RFC PATCH] Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Thu, 13 Jul 2023 12:25:14 +0200 you wrote:
> Commit c13380a55522 ("Bluetooth: btusb: Do not require hardcoded
> interface numbers") inadvertedly broke bluetooth on Intel Macbook 2014.
> The intention was to keep behavior intact when BTUSB_IFNUM_2 is set and
> otherwise allow any interface numbers. The problem is that the new logic
> condition omits the case where bInterfaceNumber is 0.
>
> Fix BTUSB_IFNUM_2 handling by allowing both interface number 0 and 2
> when the flag is set.
>
> [...]

Here is the summary with links:
- [RFC] Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014
https://git.kernel.org/bluetooth/bluetooth-next/c/f0408f0a1998

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html