Skip to content

Commit f676910

Browse files
P33MP33M
P33M
authored and
P33M
committed
dwc_otg: add handling of SPLIT transaction data toggle errors
Previously a data toggle error on packets from a USB1.1 device behind a TT would result in the Pi locking up as the driver never handled the associated interrupt. Patch adds basic retry mechanism and interrupt acknowledgement to cater for either a chance toggle error or for devices that have a broken initial toggle state (FT8U232/FT232BM).
1 parent 2bebfca commit f676910

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,13 +1921,20 @@ static int32_t handle_hc_datatglerr_intr(dwc_otg_hcd_t * hcd,
19211921
dwc_otg_qtd_t * qtd)
19221922
{
19231923
DWC_DEBUGPL(DBG_HCDI, "--Host Channel %d Interrupt: "
1924-
"Data Toggle Error--\n", hc->hc_num);
1924+
"Data Toggle Error on %s transfer--\n",
1925+
hc->hc_num, (hc->ep_is_in ? "IN" : "OUT"));
19251926

1926-
if (hc->ep_is_in) {
1927+
/* Data toggles on split transactions cause the hc to halt.
1928+
* restart transfer */
1929+
if(hc->qh->do_split)
1930+
{
1931+
qtd->error_count++;
1932+
dwc_otg_hcd_save_data_toggle(hc, hc_regs, qtd);
1933+
update_urb_state_xfer_intr(hc, hc_regs,
1934+
qtd->urb, qtd, DWC_OTG_HC_XFER_XACT_ERR);
1935+
halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_XACT_ERR);
1936+
} else if (hc->ep_is_in) {
19271937
qtd->error_count = 0;
1928-
} else {
1929-
DWC_ERROR("Data Toggle Error on OUT transfer,"
1930-
"channel %d\n", hc->hc_num);
19311938
}
19321939

19331940
disable_hc_int(hc_regs, datatglerr);
@@ -2080,6 +2087,8 @@ static void handle_hc_chhltd_intr_dma(dwc_otg_hcd_t * hcd,
20802087
handle_hc_babble_intr(hcd, hc, hc_regs, qtd);
20812088
} else if (hcint.b.frmovrun) {
20822089
handle_hc_frmovrun_intr(hcd, hc, hc_regs, qtd);
2090+
} else if (hcint.b.datatglerr) {
2091+
handle_hc_datatglerr_intr(hcd, hc, hc_regs, qtd);
20832092
} else if (!out_nak_enh) {
20842093
if (hcint.b.nyet) {
20852094
/*

0 commit comments

Comments
 (0)