Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 056b7ca2 authored by Azhar Shaikh's avatar Azhar Shaikh
Browse files

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: default avatarAzhar Shaikh <azhars@codeaurora.org>
parent 3bc1fc8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ static void ipc_bridge_int_cb(struct urb *urb)
		}
		dev->get_encap_resp++;
		/* Tell runtime pm core that we are busy */
		usb_autopm_get_interface_no_resume(dev->intf);
		usb_autopm_get_interface_async(dev->intf);
		return;
	default:
		dev_err(&dev->intf->dev, "unknown data on int ep\n");