usb: dwc2: gadget: Fix ISOC transfer complete handling for DDMA
authorMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Sat, 11 Sep 2021 18:58:30 +0000 (22:58 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Sep 2021 08:10:59 +0000 (10:10 +0200)
commitd071c7fd45dcde9fc051e5f4de2f2fb24792279e
tree901d7faadcbc097cc0507c597fe1cc2c720b5457
parent5f4bfac26173e06b49d95042f766ab429ebdb0aa
usb: dwc2: gadget: Fix ISOC transfer complete handling for DDMA

commit dbe2518b2d8eabffa74dbf7d9fdd7dacddab7fc0 upstream.

When last descriptor in a descriptor list completed with XferComplete
interrupt, core switching to handle next descriptor and assert BNA
interrupt. Both these 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")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Link: https://lore.kernel.org/r/a36981accc26cd674c5d8f8da6164344b94ec1fe.1631386531.git.Minas.Harutyunyan@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/gadget.c