USB: gadget: Fix scheduling while atomic bug in ci13xxx_udc

The current code is calling cancel_delayed_work_sync() from interrupt
handler which is causing scheduling while atomic bug.

If host sends reset or cable is disconnected, before the remote wakeup
work is scheduled, we may end up sending wakeup signaling.  But this
work can not be canceled from interrupt handler as it involves sleeping.
Check wakeup conditions before initiating the remote wakeup in work
function.

Change-Id: I150ecadfd6669ec5a01b65298d330183596ba2c7
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
1 file changed