0001-Fix-ath9k-dwc2-init-frame-overruns.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 0a4c330869fbdd1a2372609cac13a98492e0e149 Mon Sep 17 00:00:00 2001
  2. From: Hal Emmerich <hal@halemmerich.com>
  3. Date: Wed, 21 Aug 2019 16:52:41 -0500
  4. Subject: [PATCH] Fix ath9k dwc2 init frame overruns
  5. This is a workaround for ar9271 drvices using the open ath9k firmware
  6. With the dwc2 usb driver these endpoints end up throwing piles of
  7. frame overrun errors and prevent the ath9k firmware from communicating
  8. properly with the c201
  9. This fix elongates the microframes by 4 so the dwc2 and ath9k devices
  10. communicate properly. In my testing this did not impact network speeds.
  11. ---
  12. drivers/usb/dwc2/hcd_queue.c | 10 ++++++++++
  13. 1 file changed, 10 insertions(+)
  14. diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c
  15. index 68bbac6..8562db7 100644
  16. --- a/drivers/usb/dwc2/hcd_queue.c
  17. +++ b/drivers/usb/dwc2/hcd_queue.c
  18. @@ -1558,6 +1558,16 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
  19. device_ns += dwc_tt->usb_tt->think_time;
  20. qh->device_us = NS_TO_US(device_ns);
  21. + //Only enable workaround for highspeed devices, since only low and full speed devices so split, we can just check split
  22. + //The packets that fail right after the firmware is transferred are on an interrupt ep so we can use that to further narrow it down
  23. + //The ath9k device has issues with ep 3 and ep4
  24. + if(!do_split && !ep_is_isoc && ep_is_int && (urb->pipe_info.ep_num == 3 || urb->pipe_info.ep_num == 4)){
  25. + if (urb->interval == 1){
  26. + urb->interval = 4;
  27. + dev_err(hsotg->dev, "PRAWNOS Set usb urb interval to %d\n", urb->interval);
  28. + }
  29. + }
  30. +
  31. qh->device_interval = urb->interval;
  32. qh->host_interval = urb->interval * (do_split ? 8 : 1);
  33. --
  34. 2.11.0