0590-dwc_otg-fix-summarize-urb-actual_length-for-isochron.patch 1.1 KB

12345678910111213141516171819202122232425262728
  1. From 83672d68ed0199fbe119510626116a32622e4003 Mon Sep 17 00:00:00 2001
  2. From: Martin Cerveny <M.Cerveny@computer.org>
  3. Date: Mon, 13 Feb 2017 17:23:47 +0100
  4. Subject: [PATCH] dwc_otg: fix summarize urb->actual_length for isochronous
  5. transfers
  6. Kernel does not copy input data of ISO transfers to userspace
  7. if actual_length is set only in ISO transfers and not summarized
  8. in urb->actual_length. Fixes raspberrypi/linux#903
  9. ---
  10. drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 2 ++
  11. 1 file changed, 2 insertions(+)
  12. --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
  13. +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
  14. @@ -325,10 +325,12 @@ static int _complete(dwc_otg_hcd_t * hcd
  15. int i;
  16. urb->error_count = dwc_otg_hcd_urb_get_error_count(dwc_otg_urb);
  17. + urb->actual_length = 0;
  18. for (i = 0; i < urb->number_of_packets; ++i) {
  19. urb->iso_frame_desc[i].actual_length =
  20. dwc_otg_hcd_urb_get_iso_desc_actual_length
  21. (dwc_otg_urb, i);
  22. + urb->actual_length += urb->iso_frame_desc[i].actual_length;
  23. urb->iso_frame_desc[i].status =
  24. dwc_otg_hcd_urb_get_iso_desc_status(dwc_otg_urb, i);
  25. }