From a3a1c2728b6fb0278d406bf6366aa6978a7b4d7b Mon Sep 17 00:00:00 2001 From: Pratham Pratap Date: Mon, 3 May 2021 15:41:36 +0530 Subject: [PATCH] usb: gsi: Enable host remote-wakeup capability for GPS function Currently the driver is not setting is_suspended flag for GPS function which is leading to remote wakeup failure for host. Also clear rwake_inprogress flag in gsi_resume before bailing out early for GPS function so that driver can successfully do remote-wakeup for the functions that support this feature. Change-Id: I73f06c8f7b128636d0421139d068c05488d2ff06 Signed-off-by: Pratham Pratap --- drivers/usb/gadget/function/f_gsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/function/f_gsi.c b/drivers/usb/gadget/function/f_gsi.c index 8585defe7700..51db19325d90 100644 --- a/drivers/usb/gadget/function/f_gsi.c +++ b/drivers/usb/gadget/function/f_gsi.c @@ -2675,6 +2675,7 @@ static void gsi_suspend(struct usb_function *f) return; } + gsi->c_port.is_suspended = true; /* * GPS doesn't use any data interface, hence bail out as there is no * GSI specific handling needed. @@ -2684,7 +2685,6 @@ static void gsi_suspend(struct usb_function *f) return; } - gsi->c_port.is_suspended = true; block_db = true; usb_gsi_ep_op(gsi->d_port.in_ep, (void *)&block_db, GSI_EP_OP_SET_CLR_BLOCK_DBL); @@ -2735,6 +2735,8 @@ static void gsi_resume(struct usb_function *f) /* Check any pending cpkt, and queue immediately on resume */ gsi_ctrl_send_notification(gsi); + gsi->rwake_inprogress = false; + if (gsi->prot_id == IPA_USB_GPS) { log_event_dbg("%s: resume done\n", __func__); return; @@ -2754,8 +2756,6 @@ static void gsi_resume(struct usb_function *f) gsi->params->state = RNDIS_DATA_INITIALIZED; } - gsi->rwake_inprogress = false; - post_event(&gsi->d_port, EVT_RESUMED); queue_delayed_work(gsi->d_port.ipa_usb_wq, &gsi->d_port.usb_ipa_w, 0);