usb: gadget: f_ipc: Mark current state to CONNECTED before registering pdev
Currently as a part of set_alt, the driver first registers
'ipc_bridge' platform device and then marks the current_state to
IPC_CONNECTED. But as soon as the pdev is registered, the
ipc_router transport driver queues read request which will fail
because the current_state is still IPC_DISCONNECTED. Hence IPC
core misses the reply to the hello packet leading to
functionality failure.
Fix this by first marking current_state to IPC_CONNECTED and
then going to register platform device with ipc_bridge. While at
it, also use interruptible variant of wait_for_completion method
to unblock thread is request completion is stuck.
Change-Id: Ib2b5cd86f93af4947ec95047f803f8e08c156537
Signed-off-by:
Ajay Agarwal <ajaya@codeaurora.org>
Loading
Please register or sign in to comment