[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1454964669-11362-1-git-send-email-amit.pundir@linaro.org>
Date: Tue, 9 Feb 2016 02:21:09 +0530
From: Amit Pundir <amit.pundir@...aro.org>
To: linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Cc: xerox_lin <xerox_lin@....com>, Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrzej Pietrasiewicz <andrzej.p@...sung.com>,
Badhri Jagan Sridharan <badhri@...gle.com>,
Android Kernel Team <kernel-team@...roid.com>,
John Stultz <john.stultz@...aro.org>,
Sumit Semwal <sumit.semwal@...aro.org>,
Rajkumar Raghupathy <raghup@...eaurora.org>
Subject: [RFC][PATCH v2] usb: gadget: rndis: Free the response queue during REMOTE_NDIS_RESET_MSG
From: xerox_lin <xerox_lin@....com>
When rndis data transfer is in progress, some Windows7 Host PC is not
sending the GET_ENCAPSULATED_RESPONSE command for receiving the response
for the previous SEND_ENCAPSULATED_COMMAND processed.
The rndis function driver appends each response for the
SEND_ENCAPSULATED_COMMAND in a queue. As the above process got corrupted,
the Host sends a REMOTE_NDIS_RESET_MSG command to do a soft-reset.
As the rndis response queue is not freed, the previous response is sent
as a part of this REMOTE_NDIS_RESET_MSG's reset response and the Host
blocks any more Rndis transfers.
Hence free the rndis response queue as a part of this soft-reset so that
the current response for REMOTE_NDIS_RESET_MSG is sent properly during the
response command.
Cc: Felipe Balbi <balbi@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Andrzej Pietrasiewicz <andrzej.p@...sung.com>
Cc: Badhri Jagan Sridharan <badhri@...gle.com>
Cc: Android Kernel Team <kernel-team@...roid.com>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Sumit Semwal <sumit.semwal@...aro.org>
Signed-off-by: Rajkumar Raghupathy <raghup@...eaurora.org>
Signed-off-by: Xerox Lin <xerox_lin@....com>
[pundir:
* cherry-picked this patch from AOSP experimental/android-4.4 tree.
* folded in the AOSP fix to use rndis_params instead of configNr.]
Signed-off-by: Amit Pundir <amit.pundir@...aro.org>
---
v2: Use rndis_params instead of configNr in v1. Updated commit log.
v1: Cherry-picked this patch from AOSP common/experimental/android-4.4 tree.
I could not find upstream submission history for this patch, so my
apologies in advance if this has already been NACKed before.
drivers/usb/gadget/function/rndis.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c
index 70d3917..27163e8 100644
--- a/drivers/usb/gadget/function/rndis.c
+++ b/drivers/usb/gadget/function/rndis.c
@@ -681,6 +681,13 @@ static int rndis_reset_response(struct rndis_params *params,
rndis_reset_cmplt_type *resp;
rndis_resp_t *r;
+ u32 length;
+ u8 *xbuf;
+
+ /* drain the response queue */
+ while ((xbuf = rndis_get_next_response(params, &length)))
+ rndis_free_response(params, xbuf);
+
r = rndis_add_response(params, sizeof(rndis_reset_cmplt_type));
if (!r)
return -ENOMEM;
--
1.9.1
Powered by blists - more mailing lists