From: Greg Kroah-Hartman Date: Sun, 13 Nov 2016 11:22:43 +0000 (+0100) Subject: 4.8-stable patches X-Git-Tag: v4.4.32~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b44da5c635c7400061775e7513af52339c828d7f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.8-stable patches added patches: usb-dwc3-gadget-properly-account-queued-requests.patch --- diff --git a/queue-4.8/series b/queue-4.8/series index d0d940050da..3630a6c4ce4 100644 --- a/queue-4.8/series +++ b/queue-4.8/series @@ -32,3 +32,4 @@ sctp-validate-chunk-len-before-actually-using-it.patch ip6_tunnel-update-skb-protocol-to-eth_p_ipv6-in-ip6_tnl_xmit.patch packet-on-direct_xmit-limit-tso-and-csum-to-supported-devices.patch arch-powerpc-update-parameters-for-csum_tcpudp_magic-csum_tcpudp_nofold.patch +usb-dwc3-gadget-properly-account-queued-requests.patch diff --git a/queue-4.8/usb-dwc3-gadget-properly-account-queued-requests.patch b/queue-4.8/usb-dwc3-gadget-properly-account-queued-requests.patch new file mode 100644 index 00000000000..b94586f44a7 --- /dev/null +++ b/queue-4.8/usb-dwc3-gadget-properly-account-queued-requests.patch @@ -0,0 +1,51 @@ +From a9c3ca5fae6bf73770f0576eaf57d5f1305ef4b3 Mon Sep 17 00:00:00 2001 +From: Felipe Balbi +Date: Wed, 5 Oct 2016 14:24:37 +0300 +Subject: usb: dwc3: gadget: properly account queued requests + +From: Felipe Balbi + +commit a9c3ca5fae6bf73770f0576eaf57d5f1305ef4b3 upstream. + +Some requests could be accounted for multiple +times. Let's fix that so each and every requests is +accounted for only once. + +Fixes: 55a0237f8f47 ("usb: dwc3: gadget: use allocated/queued reqs for LST bit") +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/gadget.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -789,6 +789,7 @@ static void dwc3_prepare_one_trb(struct + req->trb = trb; + req->trb_dma = dwc3_trb_dma_offset(dep, trb); + req->first_trb_index = dep->trb_enqueue; ++ dep->queued_requests++; + } + + dwc3_ep_inc_enq(dep); +@@ -841,8 +842,6 @@ static void dwc3_prepare_one_trb(struct + + trb->ctrl |= DWC3_TRB_CTRL_HWO; + +- dep->queued_requests++; +- + trace_dwc3_prepare_trb(dep, trb); + } + +@@ -1963,7 +1962,9 @@ static int __dwc3_cleanup_done_trbs(stru + unsigned int s_pkt = 0; + unsigned int trb_status; + +- dep->queued_requests--; ++ if (req->trb == trb) ++ dep->queued_requests--; ++ + trace_dwc3_complete_trb(dep, trb); + + /*