From: Gregory Herrero Date: Thu, 5 Nov 2015 08:41:37 +0000 (+0100) Subject: usb: dwc2: host: ensure filling of isoc desc is correctly done X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3ac38d260fa5dc8ec26ee5b6f5330d726ec00065;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git usb: dwc2: host: ensure filling of isoc desc is correctly done Increment qtd->isoc_frame_index_last before testing it, else below check will never be true and IOC (Interrupt On Complete) bit for last frame will never be set in descriptor status. /* Set IOC for each descriptor corresponding to last frame of URB */ if (qtd->isoc_frame_index_last == qtd->urb->packet_count) dma_desc->status |= HOST_DMA_IOC; Acked-by: John Youn Signed-off-by: Gregory Herrero Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c index 78993aba9335..4b0be93dac6f 100644 --- a/drivers/usb/dwc2/hcd_ddma.c +++ b/drivers/usb/dwc2/hcd_ddma.c @@ -524,14 +524,15 @@ static void dwc2_fill_host_isoc_dma_desc(struct dwc2_hsotg *hsotg, dma_desc->status = qh->n_bytes[idx] << HOST_DMA_ISOC_NBYTES_SHIFT & HOST_DMA_ISOC_NBYTES_MASK; + qh->ntd++; + qtd->isoc_frame_index_last++; + #ifdef ISOC_URB_GIVEBACK_ASAP /* Set IOC for each descriptor corresponding to last frame of URB */ if (qtd->isoc_frame_index_last == qtd->urb->packet_count) dma_desc->status |= HOST_DMA_IOC; #endif - qh->ntd++; - qtd->isoc_frame_index_last++; } static void dwc2_init_isoc_dma_desc(struct dwc2_hsotg *hsotg,