From 86747debd95f02764bc8d9c136d6011200a4054b Mon Sep 17 00:00:00 2001 From: Vijayavardhan Vennapusa Date: Wed, 15 Nov 2017 10:52:11 +0530 Subject: [PATCH] USB: gsi: Ring Doorbell to GSI if check for suspend fails Currently GSI driver is clearing Doorbell to GSI in gsi_suspend(), when it receives function suspend and notifying suspend to GSI in work queue context. In ipa_suspend_work_handler(), driver is first checking whether GSI wrapper is ready to suspend before doing xdci_suspend(). This check fails if function resume received before ipa_suspend_work_handler() gets chance to run. Due to this, state machine still stays at CONNECTED state. When function resume is received, state machine is not handling resume event and results in not ringing Doorbell to GSI. This eventually causes data stall. Hence fix the issue by ringing Doorbell to GSI if in case check for suspend fails in ipa_suspend_work_handler. Change-Id: Ifbc03b7edde6e1be23c326118e89f805b148f9ff Signed-off-by: Vijayavardhan Vennapusa --- drivers/usb/gadget/function/f_gsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/gadget/function/f_gsi.c b/drivers/usb/gadget/function/f_gsi.c index 18e3c5cdcc24..67f7e75a9219 100644 --- a/drivers/usb/gadget/function/f_gsi.c +++ b/drivers/usb/gadget/function/f_gsi.c @@ -554,6 +554,9 @@ static int ipa_suspend_work_handler(struct gsi_data_port *d_port) if (!usb_gsi_ep_op(gsi->d_port.in_ep, (void *) &f_suspend, GSI_EP_OP_CHECK_FOR_SUSPEND)) { ret = -EFAULT; + block_db = false; + usb_gsi_ep_op(d_port->in_ep, (void *)&block_db, + GSI_EP_OP_SET_CLR_BLOCK_DBL); goto done; }