Re: [PATCH v4 02/33] Bluetooth: btusb: Fix MediaTek ISO claim locking

From: Leon Romanovsky

Date: Wed Nov 25 2026 - 03:49:37 EST


On Tue, Nov 24, 2026 at 11:39:40AM +0100, Oliver Neukum wrote:
>
>
> On 24.11.26 10:43, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@xxxxxxxxxx>
> >
> > MediaTek ISO claims are performed from HCI setup work outside USB probe.
> > Locking only the interface does not protect the claim against teardown
> > of the parent device. Unconditionally waiting for the parent lock can
> > deadlock with disconnect while it drains the setup work.
> Hi,
>
> your patch raises a question. Can usb_claim_interface() ever be
> used safely outside probe() without this kind of locking?

No, it cannot. This is why need_parent_lock is set for every caller of
usb_driver_claim_interface() running from .probe().

> If the answer to that is negative, should the locking be integrated into
> usbcore?

Not in the current upstream code. Currently, only two callers of
usb_driver_claim_interface() do not run through .probe: MediaTek and usbfs.
usbfs already holds the lock, leaving only MediaTek, which does not.

Therefore, the caller should take the lock, and MediaTek is the only caller
that needs to be fixed.

Thanks

>
> Regards
> Oliver
>