[PATCH 4.11 53/78] usb: r8a66597-hcd: select a different endpoint on timeout
From: Greg Kroah-Hartman
Date: Mon Jun 19 2017 - 11:20:25 EST
4.11-stable review patch. If anyone has any objections, please let me know.
From: Chris Brandt <chris.brandt@xxxxxxxxxxx>
commit 1f873d857b6c2fefb4dada952674aa01bcfb92bd upstream.
If multiple endpoints on a single device have pending IN URBs and one
endpoint times out due to NAKs (perfectly legal), select a different
endpoint URB to try.
The existing code only checked to see another device address has pending
URBs and ignores other IN endpoints on the current device address. This
leads to endpoints never getting serviced if one endpoint is using NAK as
a flow control method.
Fixes: 5d3043586db4 ("usb: r8a66597-hcd: host controller driver for R8A6659")
Signed-off-by: Chris Brandt <chris.brandt@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
drivers/usb/host/r8a66597-hcd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@@ -1785,6 +1785,7 @@ static void r8a66597_td_timer(unsigned l
pipe = td->pipe;
+ /* Select a different address or endpoint */
new_td = td;
@@ -1794,7 +1795,8 @@ static void r8a66597_td_timer(unsigned l
new_td = td;
- } while (td != new_td && td->address == new_td->address);
+ } while (td != new_td && td->address == new_td->address &&
+ td->pipe->info.epnum == new_td->pipe->info.epnum);