[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1578512578.927773857@decadent.org.uk>
Date: Wed, 08 Jan 2020 19:43:37 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Amit Pundir" <amit.pundir@...aro.org>,
"Arnd Bergmann" <arnd@...db.de>, "Xerox Lin" <xerox_lin@....com>,
"Rajkumar Raghupathy" <raghup@...eaurora.org>,
"Felipe Balbi" <felipe.balbi@...ux.intel.com>
Subject: [PATCH 3.16 39/63] usb: gadget: rndis: free response queue during
REMOTE_NDIS_RESET_MSG
3.16.81-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Xerox Lin <xerox_lin@....com>
commit 207707d8fd48ebc977fb2b2794004a020e1ee08e upstream.
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
block any more Rndis transfers.
Hence free the rndis response queue as a part of this soft-reset so that
the correct response for REMOTE_NDIS_RESET_MSG is sent properly during the
response command.
Signed-off-by: Rajkumar Raghupathy <raghup@...eaurora.org>
Signed-off-by: Xerox Lin <xerox_lin@....com>
[AmitP: Cherry-picked this patch and folded other relevant
fixes from Android common kernel android-4.4]
Signed-off-by: Amit Pundir <amit.pundir@...aro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@...ux.intel.com>
Cc: Arnd Bergmann <arnd@...db.de>
[bwh: Backported to 3.16:
- Pass configNr instead of params as first argument to
rndis_{get_next,free}_response()
- Adjust filename, context]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/usb/gadget/rndis.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -686,6 +686,12 @@ static int rndis_reset_response(int conf
rndis_reset_cmplt_type *resp;
rndis_resp_t *r;
struct rndis_params *params = rndis_per_dev_params + configNr;
+ u8 *xbuf;
+ u32 length;
+
+ /* drain the response queue */
+ while ((xbuf = rndis_get_next_response(configNr, &length)))
+ rndis_free_response(configNr, xbuf);
r = rndis_add_response(configNr, sizeof(rndis_reset_cmplt_type));
if (!r)
Powered by blists - more mailing lists