mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-02-15 04:42:02 +00:00
49 lines
1.8 KiB
Diff
49 lines
1.8 KiB
Diff
From aa3c8cd4ea9e49269e0c0e1072c0b91c7b49e14e Mon Sep 17 00:00:00 2001
|
|
From: P33M <P33M@users.noreply.github.com>
|
|
Date: Fri, 24 Nov 2017 13:49:26 +0000
|
|
Subject: [PATCH 148/277] fiq_fsm: rewind DMA pointer for OUT transactions that
|
|
fail (#2288)
|
|
|
|
See: https://github.com/raspberrypi/linux/issues/2140
|
|
---
|
|
drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 12 ++++++++++++
|
|
1 file changed, 12 insertions(+)
|
|
|
|
diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
|
|
index e47d5b6de3ad..ec804c7cd06d 100644
|
|
--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
|
|
+++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
|
|
@@ -266,6 +266,15 @@ static void notrace fiq_fsm_reload_hctsiz(struct fiq_state *st, int n)
|
|
FIQ_WRITE(st->dwc_regs_base + HC_START + (HC_OFFSET * n) + HCTSIZ, hctsiz.d32);
|
|
}
|
|
|
|
+/**
|
|
+ * fiq_fsm_reload_hcdma() - for OUT transactions, rewind DMA pointer
|
|
+ */
|
|
+static void notrace fiq_fsm_reload_hcdma(struct fiq_state *st, int n)
|
|
+{
|
|
+ hcdma_data_t hcdma = st->channel[n].hcdma_copy;
|
|
+ FIQ_WRITE(st->dwc_regs_base + HC_START + (HC_OFFSET * n) + HC_DMA, hcdma.d32);
|
|
+}
|
|
+
|
|
/**
|
|
* fiq_iso_out_advance() - update DMA address and split position bits
|
|
* for isochronous OUT transactions.
|
|
@@ -827,11 +836,14 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c
|
|
fiq_fsm_setup_csplit(state, n);
|
|
} else if (hcint.b.nak) {
|
|
// No buffer space in TT. Retry on a uframe boundary.
|
|
+ fiq_fsm_reload_hcdma(state, n);
|
|
st->fsm = FIQ_NP_SSPLIT_RETRY;
|
|
handled = 1;
|
|
} else if (hcint.b.xacterr) {
|
|
// The only other one we care about is xacterr. This implies HS bus error - retry.
|
|
st->nr_errors++;
|
|
+ if(st->hcchar_copy.b.epdir == 0)
|
|
+ fiq_fsm_reload_hcdma(state, n);
|
|
st->fsm = FIQ_NP_SSPLIT_RETRY;
|
|
if (st->nr_errors >= 3) {
|
|
st->fsm = FIQ_NP_SPLIT_HS_ABORTED;
|
|
--
|
|
2.16.1
|
|
|