Skip to content

Commit 4e36213

Browse files
P33MP33M
authored andcommitted
dwc_otg: mask correct interrupts after transaction error recovery
The dwc_otg driver will unmask certain interrupts on a transaction that previously halted in the error state in order to reset the QTD error count. The various fine-grained interrupt handlers do not consider that other interrupts besides themselves were unmasked. By disabling the two other interrupts only ever enabled in DMA mode for this purpose, we can avoid unnecessary function calls in the IRQ handler. This will also prevent an unneccesary FIQ interrupt from being generated if the FIQ is enabled.
1 parent 245f716 commit 4e36213

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,11 @@ static int32_t handle_hc_nak_intr(dwc_otg_hcd_t * hcd,
18511851
* transfers in DMA mode for the sole purpose of
18521852
* resetting the error count after a transaction error
18531853
* occurs. The core will continue transferring data.
1854+
* Disable other interrupts unmasked for the same
1855+
* reason.
18541856
*/
1857+
disable_hc_int(hc_regs, datatglerr);
1858+
disable_hc_int(hc_regs, ack);
18551859
qtd->error_count = 0;
18561860
goto handle_nak_done;
18571861
}
@@ -1963,6 +1967,15 @@ static int32_t handle_hc_ack_intr(dwc_otg_hcd_t * hcd,
19631967
halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_ACK);
19641968
}
19651969
} else {
1970+
/*
1971+
* An unmasked ACK on a non-split DMA transaction is
1972+
* for the sole purpose of resetting error counts. Disable other
1973+
* interrupts unmasked for the same reason.
1974+
*/
1975+
if(hcd->core_if->dma_enable) {
1976+
disable_hc_int(hc_regs, datatglerr);
1977+
disable_hc_int(hc_regs, nak);
1978+
}
19661979
qtd->error_count = 0;
19671980

19681981
if (hc->qh->ping_state) {
@@ -2328,6 +2341,14 @@ static int32_t handle_hc_datatglerr_intr(dwc_otg_hcd_t * hcd,
23282341
qtd->urb, qtd, DWC_OTG_HC_XFER_XACT_ERR);
23292342
halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_XACT_ERR);
23302343
} else if (hc->ep_is_in) {
2344+
/* An unmasked data toggle error on a non-split DMA transaction is
2345+
* for the sole purpose of resetting error counts. Disable other
2346+
* interrupts unmasked for the same reason.
2347+
*/
2348+
if(hcd->core_if->dma_enable) {
2349+
disable_hc_int(hc_regs, ack);
2350+
disable_hc_int(hc_regs, nak);
2351+
}
23312352
qtd->error_count = 0;
23322353
}
23332354

0 commit comments

Comments
 (0)