On Thu, 4 Jul 2019, EJ Hsu wrote:
> Based on my initial debugging, USB CV TD 9.13 will consecutively set device
> to configuration #1 by sending "Set Configuration" transfer.
> So, in set_config() function, it will try to disable each interface first and
> then set up each interface. That is, the fsg_disable() will be called first
> and then fsg_set_alt().
> There might be a chance that the request (FSG_STATE_DISCONNECT) from
> fsg_disabled() has not been handled by fsg_main_thread before fsg_set_alt()
> is called.
> In this case, fsg_set_alt() will try to queue its request
> (FSG_STATE_CONFIG_CHANGE) to fsg_main_thread, but find that
> FSG_STATE_DISCONNECT has not been handled.
> Because the priority of FSG_STATE_DISCONNECT is higher than
> FSG_STATE_CONFIG_CHANGE, FSG_STATE_CONFIG_CHANGE will be discarded
> accordingly.
> This might lead to the missing of usb_composite_setup_continue() which result
> in the failure of "Set Configuration" transfer.
>
> Will push a new patch to fix this issue.
Have you seen these emails?
https://marc.info/?l=linux-usb&m=156222739324546&w=2
https://marc.info/?l=linux-usb&m=156222747024558&w=2
They are probably related to this same issue.
Alan Stern