usb: dwc3: gadget: Check controller status with endpoint enable/disable
Some USB function driver (e.g. mass storage) performs USB endpoint enable
and disable functionality from worker thread context instead of composite/
controller work context. This may result into endpoint enable/disable
racing against USB controller low power mode functionality with USB cable
disconnect. This race may result into unclock register access. Hence fix
this issue by checking USB controller status and perform resume/autosuspend
with endpoint disable whereas return -EINVAL with endpoint enable if USB
controller is suspended (in low power mode).
Change-Id: I76cd75fc90b52ceefe099f48be6c880c04136301
Signed-off-by:
Mayank Rana <mrana@codeaurora.org>
Loading
Please register or sign in to comment