summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/params.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2018-01-12 11:26:16 +0100
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-03-13 10:47:39 +0200
commit946ef68ad4e45aa048a5fb41ce8823ed29da866a (patch)
tree10659b06d018cc8c328e6806c8c19a5f27e6a11f /drivers/usb/dwc2/params.c
parent4058ebf33cb0be88ca516f968eda24ab7b6b93e4 (diff)
downloadlinux-946ef68ad4e45aa048a5fb41ce8823ed29da866a.tar.bz2
usb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS
Some UDC drivers (like the DWC3) expect that the response to a setup() request is queued from within the setup function itself so that it is available as soon as setup() has completed. Upon receiving a setup request the function fs driver creates an event that is made available to userspace. And only once userspace has acknowledged that event the response to the setup request is queued. So it violates the requirement of those UDC drivers and random failures can be observed. This is basically a race condition and if userspace is able to read the event and queue the response fast enough all is good. But if it is not, for example because other processes are currently scheduled to run, the USB host that sent the setup request will observe an error. To avoid this the gadget framework provides the USB_GADGET_DELAYED_STATUS return code. If a setup() callback returns this value the UDC driver is aware that response is not yet available and can uses the appropriate methods to handle this case. Since in the case of function fs the response will never be available when the setup() function returns make sure that this status code is used. This fixed random occasional failures that were previously observed on a DWC3 based system under high system load. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc2/params.c')
0 files changed, 0 insertions, 0 deletions