Re: git: 240330a85e5f - main - libusb: don't treat EINVAL from USB_FS_COMPLETE as device detach

From: Li-Wen Hsu <lwhsu_at_freebsd.org>
Date: Fri, 26 Jun 2026 00:51:33 UTC
On Thu, Jun 25, 2026 at 20:05 ShengYi Hung <aokblast@freebsd.org> wrote:

> The branch main has been updated by aokblast:
>
> URL:
> https://cgit.FreeBSD.org/src/commit/?id=240330a85e5f7f5d448123902ebee4136ef221fd
>
> commit 240330a85e5f7f5d448123902ebee4136ef221fd
> Author:     ShengYi Hung <aokblast@FreeBSD.org>
> AuthorDate: 2026-06-25 22:38:17 +0000
> Commit:     ShengYi Hung <aokblast@FreeBSD.org>
> CommitDate: 2026-06-25 22:58:23 +0000
>
>     libusb: don't treat EINVAL from USB_FS_COMPLETE as device detach
>
>     ugen20_process() treats any non-EBUSY errno returned by USB_FS_COMPLETE
>     as device detach and returns LIBUSB20_ERROR_OTHER. This causes libusb10
>     to set device_is_gone and fail all subsequent transfer with
>     LIBUSB_ERROR_NO_DEVICE.
>
>     However, USB_FS_COMPLETE can also return EINVAL when a completion
>     references an endpoint that no longer exists, for example after
>     SET_INTERFACE or SET_CONFIG removes and recreates endpoints. This is a
>     transient condition and does not indicate device detach.
>
>     Treat EINVAL the same as EBUSY and stop draining completions. This
>     prevents a guest selecting an isochronous streaming altsetting from
>     permanently breaking the passed-through device.
>
>     Reviewed by:    bapt
>     Event:          Halifax Hackathon 202606
>     Location:       Peggy's Cove Rock


They really push the commit at the cove:

https://p.obiw.ac/s/aokblast-peggy

>