usb: misc: Resume IPC interface on receiving interrupt complete callback
usb_autopm_get_interface_no_resume() called from interrupt URB complete
callback only increments PM usage count but does not change the runtime
PM status.
Consider a case where interrupt complete callback is called and at the
same time usb_runtime_idle() for USB device is called after all interfaces
are suspended. usb_runtime_idle() will return -EBUSY as the PM usage count
is non-zero.
When the IPC bridge driver finishes with the read URB, it calls
usb_autopm_put_interface_async() which returns -EAGAIN, as IPC
interface runtime PM status is already RPM_SUSPENDED. Since the
usb_runtime_idle() call fails, the autosuspend timer will not be re-armed
and hence the idle() callback for the USB device will never be called.
So to fix this, in interrupt completion callback, replace
usb_autopm_get_interface_no_resume() with usb_autopm_get_interface_async()
which will not only increment the PM usage count but also change the
runtime PM status of IPC interface and if there is a suspend
in progress, as this is an asynchronous call, it just returns -EINPROGRESS
and the IPC bridge RX state machine ensures that the suspend is aborted.
CRs-Fixed: 701097
Change-Id: Id29c6c7b7b394cd8e734326c8c7804f3180d67ad
Signed-off-by:
Azhar Shaikh <azhars@codeaurora.org>
Loading
Please register or sign in to comment