[PATCH] Bluetooth: btusb: do not probe non-HCI interfaces

Johann Fischer via B4 Relay posted 1 patch 3 weeks ago
drivers/bluetooth/btusb.c | 5 +++++
1 file changed, 5 insertions(+)
[PATCH] Bluetooth: btusb: do not probe non-HCI interfaces
Posted by Johann Fischer via B4 Relay 3 weeks ago
From: Johann Fischer <johann.fischer@nordicsemi.no>

If the driver selects BTUSB_PROTO_H4, the second interface (voice
channels) remains unclaimed. Then, the btusb_probe() is called for the
second interface. It misidentifies the interface as one that supports
legacy mode and fails with "failed to enumerate endpoints".

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
---
 drivers/bluetooth/btusb.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index dfefb43fb792..44f0db347643 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -4293,6 +4293,11 @@ static int btusb_probe(struct usb_interface *intf,
 			return -ENODEV;
 	}
 
+	/*  Skip interfaces that do not implement the HCI transport */
+	if (usb_find_common_endpoints(intf->cur_altsetting,
+				      &bulk_rx_ep, &bulk_tx_ep, &intr_ep, NULL))
+		return -ENODEV;
+
 	data = kzalloc_obj(*data);
 	if (!data)
 		return -ENOMEM;

---
base-commit: 88a8184cb44c8952e6a6fd21e250445300d1c7aa
change-id: 20260904-btusb-skip-non-hci-ifaces-b52ea298677b

Best regards,
--  
Johann
Re: [PATCH] Bluetooth: btusb: do not probe non-HCI interfaces
Posted by Luiz Augusto von Dentz 2 weeks, 3 days ago
Hi Johann,

On Fri, Sep 4, 2026 at 6:24 PM Johann Fischer via B4 Relay
<devnull+johann.fischer.nordicsemi.no@kernel.org> wrote:
>
> From: Johann Fischer <johann.fischer@nordicsemi.no>
>
> If the driver selects BTUSB_PROTO_H4, the second interface (voice
> channels) remains unclaimed. Then, the btusb_probe() is called for the
> second interface. It misidentifies the interface as one that supports
> legacy mode and fails with "failed to enumerate endpoints".
>
> Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
> ---
>  drivers/bluetooth/btusb.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index dfefb43fb792..44f0db347643 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -4293,6 +4293,11 @@ static int btusb_probe(struct usb_interface *intf,
>                         return -ENODEV;
>         }
>
> +       /*  Skip interfaces that do not implement the HCI transport */
> +       if (usb_find_common_endpoints(intf->cur_altsetting,
> +                                     &bulk_rx_ep, &bulk_tx_ep, &intr_ep, NULL))
> +               return -ENODEV;

https://sashiko.dev/#/patchset/20260905-btusb-skip-non-hci-ifaces-v1-1-32dda494122f%40nordicsemi.no

Afaik it is possible to have devices implementing just H4
mode/altsetting. Perhaps we should claim both interfaces to avoid a
second probe?

>         data = kzalloc_obj(*data);
>         if (!data)
>                 return -ENOMEM;
>
> ---
> base-commit: 88a8184cb44c8952e6a6fd21e250445300d1c7aa
> change-id: 20260904-btusb-skip-non-hci-ifaces-b52ea298677b
>
> Best regards,
> --
> Johann
>
>


-- 
Luiz Augusto von Dentz