diff mbox series

usb: dwc2: gadget: Fix ISOC transfer complete handling for DDMA

Message ID df7851e6416a7817140c2be65a479a2650d746d8.1631356397.git.Minas.Harutyunyan@synopsys.com (mailing list archive)
State Superseded
Headers show
Series usb: dwc2: gadget: Fix ISOC transfer complete handling for DDMA | expand

Commit Message

Minas Harutyunyan Sept. 11, 2021, 3:16 p.m. UTC
When last descriptor in a descriptor list completed with XferComplete
interrupt, core switching to handle next descriptor and assert BNA
interrupt. This both interrupts are set while dwc2_hsotg_epint()
handler called. Each interrupt should be handled separately: first
XferComplete interrupt then BNA interrupt, otherwise last completed
transfer will not be giveback to function driver as completed
request.

Fixes: 729cac693eec ("usb: dwc2: Change ISOC DDMA flow")
Signed-off-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
---
 drivers/usb/dwc2/gadget.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)


base-commit: 1b4f3dfb4792f03b139edf10124fcbeb44e608e6

Comments

Sergey Shtylyov Sept. 11, 2021, 6:44 p.m. UTC | #1
Hello!

On 11.09.2021 18:16, Minas Harutyunyan wrote:

> When last descriptor in a descriptor list completed with XferComplete
> interrupt, core switching to handle next descriptor and assert BNA
> interrupt. This both interrupts are set while dwc2_hsotg_epint()

    Both these...

> handler called. Each interrupt should be handled separately: first
> XferComplete interrupt then BNA interrupt, otherwise last completed
> transfer will not be giveback to function driver as completed
> request.
> 
> Fixes: 729cac693eec ("usb: dwc2: Change ISOC DDMA flow")
> Signed-off-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
> ---
>   drivers/usb/dwc2/gadget.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 837237e4bc96..1c11fb89406d 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
[...]
> base-commit: 1b4f3dfb4792f03b139edf10124fcbeb44e608e6

    Hm?

MBR, Sergei
diff mbox series

Patch

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 837237e4bc96..1c11fb89406d 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3039,9 +3039,7 @@  static void dwc2_hsotg_epint(struct dwc2_hsotg *hsotg, unsigned int idx,
 
 		/* In DDMA handle isochronous requests separately */
 		if (using_desc_dma(hsotg) && hs_ep->isochronous) {
-			/* XferCompl set along with BNA */
-			if (!(ints & DXEPINT_BNAINTR))
-				dwc2_gadget_complete_isoc_request_ddma(hs_ep);
+			dwc2_gadget_complete_isoc_request_ddma(hs_ep);
 		} else if (dir_in) {
 			/*
 			 * We get OutDone from the FIFO, so we only