On Tue, Feb 02, 2021 at 10:35:38AM +0000, Stuart Henderson wrote: > On 2021/02/02 10:02, Edd Barrett wrote: > > Hi, > > > > Apologies for breaking stuff. > > > > On Tue, Feb 02, 2021 at 07:24:34AM +0100, Marcus Glocker wrote: > > > Edd: > > > Can you please also double check if this still works with your > > > uaudio(4) device? > > > > My device works with your diff. > > > > But, I'm not sure I understand why the change broke the device. Maybe we > > should update the comments in the code to better explain? > > Let's see if it fixes the umb first. If my thought processes are correct > the previous code would have returned invalid and skipped the last three > interfaces (numbered 12, 13 and 13)..
That's how this umb(4) device interfaces are setup: Index Interface Number ----- --------------- 0 0 1 2 2 3 3 12 4 13 Now our new usbd_device2interface_handle() is strictly checking whether the indexed interface number is matching the requested interface number. With this more strict behavior, ugen(4):ugen_set_config() will fail on index 1, where we never match interface number 2. Because of that ugen(4) calls usbd_deactivate(), and the device is busted ... Now we can argue whether the behavior of ugen(4) is entirely correct, and so forth, but at this point I really think we should make usbd_device2interface_handle() backwards compatible again, because otherwise I think we'll go down a rabbit hole of such situations.