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

Commit e594cb26 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by Mayank Rana
Browse files

usb: gsi: Fix runtime PM usage count for MBIM interface



GSI Driver get the usage count in work handler when set_alt 1 happens
and this counter will decrement in disconnect work due to cable disconnect
or in gsi_suspend for suspended state.

In this case set alt to 0 came for MBIM interface and clear the
data_interface_up flag. After that suspend happens and does not decrement
the counter in gsi_suspend. This causes a mismatch of usage count and
usb not entering to low power mode.

Fix this by checking for USB_PROT_GPS_CTRL instead of data_interface_up.

Change-Id: Iaabf3de46ed72e33980d1e3e386e8ca0ae651c74
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent b3784517
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2556,7 +2556,11 @@ static void gsi_suspend(struct usb_function *f)
		return;
	}

	if (!gsi->data_interface_up) {
	/*
	 * GPS doesn't use any data interface, hence bail out as there is no
	 * GSI specific handling needed.
	 */
	if (gsi->prot_id == USB_PROT_GPS_CTRL) {
		log_event_dbg("%s: suspend done\n", __func__);
		return;
	}
@@ -2604,7 +2608,7 @@ static void gsi_resume(struct usb_function *f)
	/* Check any pending cpkt, and queue immediately on resume */
	gsi_ctrl_send_notification(gsi);

	if (!gsi->data_interface_up) {
	if (gsi->prot_id == USB_PROT_GPS_CTRL) {
		log_event_dbg("%s: resume done\n", __func__);
		return;
	}