From 1246a265e1fb348a8b12956cb59337db60bd1f7d Mon Sep 17 00:00:00 2001 From: Feng Mingli Date: Wed, 12 Jul 2017 16:54:22 +0800 Subject: [PATCH] usb: dwc_otg_310: hcd: fix isoc urb actual length USB isochronous urb consists of some isoc frames, urb use iso_frame_desc structure record actual_length, then device drivers always use this and don't care urb actual_length. But in usb devio driver, processcompl() function will process urb complete and copy data to user depend on urb actual_length. In dwc controller driver, update_isoc_urb_state() function will only update isoc frames actual_length, urb actual_length will be 0. When use usb devio driver, there is no data copy to user, so need update urb actual_length at the same time. TEST=use libusb to transport isochronous data Change-Id: I1dc8e8d8c6609924626761525b98f41a739aeb65 Signed-off-by: Feng Mingli Signed-off-by: William Wu --- drivers/usb/dwc_otg_310/dwc_otg_hcd_intr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc_otg_310/dwc_otg_hcd_intr.c b/drivers/usb/dwc_otg_310/dwc_otg_hcd_intr.c index 98271c7805e2..1d1046b65b2f 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_hcd_intr.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_hcd_intr.c @@ -724,6 +724,7 @@ update_isoc_urb_state(dwc_otg_hcd_t *hcd, frame_desc->status = 0; frame_desc->actual_length = get_actual_xfer_length(hc, hc_regs, qtd, halt_status, NULL); + urb->actual_length += frame_desc->actual_length; /* non DWORD-aligned buffer case handling. */ if (hc->align_buff && frame_desc->actual_length && hc->ep_is_in) { @@ -752,6 +753,7 @@ update_isoc_urb_state(dwc_otg_hcd_t *hcd, frame_desc->status = -DWC_E_PROTOCOL; frame_desc->actual_length = get_actual_xfer_length(hc, hc_regs, qtd, halt_status, NULL); + urb->actual_length += frame_desc->actual_length; /* non DWORD-aligned buffer case handling. */ if (hc->align_buff && frame_desc->actual_length && hc->ep_is_in) { -- 2.34.1