Skip to contentSkip to conversation

USB: gadget: atmel_usba_udc: fix transfer hang issue

PATCH New Bo Shen 2 participants 2 messages Dec 15, 2014 – Dec 16, 2014

Subsystems (2)
lore
Share & tools
lore

Bo Shen

author
#0 lore raw

PATCH 1/1 USB: gadget: atmel_usba_udc: fix transfer hang issue

When receive data, the RXRDY in status register set by hardware after a new packet has been stored in the endpoint FIFO. After, we copy from FIFO, we clear it, make the FIFO can be accessed again.
In the receive_data() function, this bit RXRDY has been cleared. So, after the receive_data() function return, this bit should not be cleared again, or else it will cause the accessing FIFO corrupt, which will make the data loss.

---

 drivers/usb/gadget/atmel_usba_udc.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/gadget/atmel_usba_udc.c +0 -1
index 12628ef..fbc74f3 100644
@@ -1062,7 +1062,6 @@ static void usba_ep_irq(struct usba_udc *udc, struct usba_ep *ep)
 	if ((epstatus & epctrl) & USBA_RX_BK_RDY) {
 		DBG(DBG_BUS, "%s: RX data ready\n", ep->ep.name);
 		receive_data(ep);
-		usba_ep_writel(ep, CLR_STA, USBA_RX_BK_RDY);
 	}
 }
 
Signature · 1 line
2.1.0.24.g4109c28
Applied
#1 lore raw

PATCH 1/1 USB: gadget: atmel_usba_udc: fix transfer hang issue

Quoted 10 lines · Bo Shen

When receive data, the RXRDY in status register set by hardware after a new packet has been stored in the endpoint FIFO. After, we copy from FIFO, we clear it, make the FIFO can be accessed again.
In the receive_data() function, this bit RXRDY has been cleared. So, after the receive_data() function return, this bit should not be cleared again, or else it will cause the accessing FIFO corrupt, which will make the data loss.

Applied, thanks!

Best regards,
Marek Vasut