1 From 3d0898f22d62dd7a05c39de9ea7e200689dc6c20 Mon Sep 17 00:00:00 2001
2 From: P33M <P33M@users.noreply.github.com>
3 Date: Fri, 24 Nov 2017 13:49:26 +0000
4 Subject: [PATCH 135/454] fiq_fsm: rewind DMA pointer for OUT transactions that
7 See: https://github.com/raspberrypi/linux/issues/2140
9 drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 12 ++++++++++++
10 1 file changed, 12 insertions(+)
12 --- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
13 +++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
14 @@ -267,6 +267,15 @@ static void notrace fiq_fsm_reload_hctsi
18 + * fiq_fsm_reload_hcdma() - for OUT transactions, rewind DMA pointer
20 +static void notrace fiq_fsm_reload_hcdma(struct fiq_state *st, int n)
22 + hcdma_data_t hcdma = st->channel[n].hcdma_copy;
23 + FIQ_WRITE(st->dwc_regs_base + HC_START + (HC_OFFSET * n) + HC_DMA, hcdma.d32);
27 * fiq_iso_out_advance() - update DMA address and split position bits
28 * for isochronous OUT transactions.
30 @@ -827,11 +836,14 @@ static int notrace noinline fiq_fsm_do_h
31 fiq_fsm_setup_csplit(state, n);
32 } else if (hcint.b.nak) {
33 // No buffer space in TT. Retry on a uframe boundary.
34 + fiq_fsm_reload_hcdma(state, n);
35 st->fsm = FIQ_NP_SSPLIT_RETRY;
37 } else if (hcint.b.xacterr) {
38 // The only other one we care about is xacterr. This implies HS bus error - retry.
40 + if(st->hcchar_copy.b.epdir == 0)
41 + fiq_fsm_reload_hcdma(state, n);
42 st->fsm = FIQ_NP_SSPLIT_RETRY;
43 if (st->nr_errors >= 3) {
44 st->fsm = FIQ_NP_SPLIT_HS_ABORTED;