Hi, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> writes: > On Mon, Apr 26, 2021 at 03:52:46PM +0300, Felipe Balbi wrote: >> yeah, this is a requirement by the spec, IIRC. A SetAlt to the same >> interface/altSetting means the host wants to reset that altSetting. From >> the peripheral point of view that means disabling the endpoints and >> reenabling them. >> >> I'm just not entirely sure if we should do this in u_audio or >> f_uac[12].c. Arguably, composite.c could detect this and disable the >> altSetting, but that would require a huge refactor on the framework. >> >> My gut feeling is that for the minimal bug fix, we should patch >> f_uac[12].c, but all audio function drivers have the same exact bug, so >> I don't know. >> >> If we follow the "standard" of patching the relevant set_alt functions >> in the function drivers, the moment we decide to go for a refactoring, >> it'll be easier to see common constructs. > > FWIW, f_mass_storage.c handles this in its do_set_interface() routine. > That routine first deallocates any related request buffers and disables > any enabled endpoints in the interface. It then goes on to enable > endpoints for the new alternate setting and allocate request buffers. > > The audio function drivers could follow this approach. right, that's what all other drivers do, in fact. Only audio seems to be different. The question here is whether to patch every f_uac*.c (there are three of them) or patch it in the generic u_audio.c -- balbi
Attachment:
signature.asc
Description: PGP signature