summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Kumar <hemantk@codeaurora.org>2016-12-08 17:37:53 -0800
committerHemant Kumar <hemantk@codeaurora.org>2016-12-12 15:45:22 -0800
commit108e051cd48d4a79439bcfb517cc5cb659d34dfd (patch)
tree791a68a575705783d21a3a65bb943b5fb48e9aee
parent368fecd7df5b203a5ce684a0c77726a5690c1147 (diff)
usb: gadget: Reset notify count to 0 upon completion for RNDIS
When host RNDIS sends reset message it skips response available notification and directly sends get encap response. This causes notify count to become > 1. As a result when notify completion happens driver is queuing another notify response available when there is no legitimate response to send from device side. Hence reset notify count back to 0 after the completion of notify response, so that next notification will only be sent when there is a send encap command sent by host. Change-Id: I242478408f8cb60fb5af5c741dbf2e8bf3e38af8 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
-rw-r--r--drivers/usb/gadget/function/f_gsi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_gsi.c b/drivers/usb/gadget/function/f_gsi.c
index af20033b621f..961af43bc9bd 100644
--- a/drivers/usb/gadget/function/f_gsi.c
+++ b/drivers/usb/gadget/function/f_gsi.c
@@ -1467,7 +1467,15 @@ static void gsi_ctrl_notify_resp_complete(struct usb_ep *ep,
event->bNotificationType, req->status);
/* FALLTHROUGH */
case 0:
- /*
+ /* no need to handle multiple resp available for RNDIS */
+ if (gsi->prot_id == IPA_USB_RNDIS) {
+ atomic_set(&gsi->c_port.notify_count, 0);
+ log_event_dbg("notify_count = %d",
+ atomic_read(&gsi->c_port.notify_count));
+ break;
+ }
+
+ /*
* handle multiple pending resp available
* notifications by queuing same until we're done,
* rest of the notification require queuing new