diff options
author | Nick Hudson <skrll@netbsd.org> | 2014-09-11 15:22:48 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-11 15:39:22 -0700 |
commit | 151d0cbdbe8609e8489d10ddb7aed6e431fe6b5d (patch) | |
tree | 38ca0aafd37bf105ab610018a255734e35da5545 /drivers/usb/dwc2 | |
parent | 87df8ac3d2e4f47f3d24e6038110feebbe8954cf (diff) | |
download | blackbird-op-linux-151d0cbdbe8609e8489d10ddb7aed6e431fe6b5d.tar.gz blackbird-op-linux-151d0cbdbe8609e8489d10ddb7aed6e431fe6b5d.zip |
usb: dwc2: make the scheduler handle excessive NAKs better
I'm seeing problems with a d-link dwcl-g122 wifi dongle that
someone sent me. There are reports of other wifi dongles with the
same/similar problem. The devices appear to be NAKing to the point
of confusing the dwc2 driver completely.
The attached patch helps with my d-link dwl-g122 - it's adapted
from the Raspberry Pi dwc_otg driver, which is a modified version
of the Synopsys vendor driver. The error recovery is still valid
after the patch, I think.
Cc: Dom Cobley <popcornmix@gmail.com>
Signed-off-by: Nick Hudson <skrll@netbsd.org>
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r-- | drivers/usb/dwc2/hcd_intr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index 47b9eb5389b4..f06249c1b918 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c @@ -1890,12 +1890,20 @@ static void dwc2_hc_chhltd_intr_dma(struct dwc2_hsotg *hsotg, "hcint 0x%08x, intsts 0x%08x\n", chan->hcint, readl(hsotg->regs + GINTSTS)); + goto error; } } } else { dev_info(hsotg->dev, "NYET/NAK/ACK/other in non-error case, 0x%08x\n", chan->hcint); +error: + /* Failthrough: use 3-strikes rule */ + qtd->error_count++; + dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb, + qtd, DWC2_HC_XFER_XACT_ERR); + dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd); + dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR); } } |