usb: gadget: udc: atmel: fix possible IN hang issue
authorBo Shen <voice.shen@atmel.com>
Wed, 17 Dec 2014 09:18:49 +0000 (17:18 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 20 Feb 2015 00:49:36 +0000 (00:49 +0000)
commit0658cbbe33d6170980eebf3b473be5489bec3c9d
tree6170016ab225a04bac2e1bef78285b52dab6bf06
parent226685fb127585285960b2cf56574bcdfac05bc4
usb: gadget: udc: atmel: fix possible IN hang issue

commit 6785a1034461c2d2c205215f63a50a740896e55b upstream.

When receive data, the RXRDY in status register set by hardware
after a new packet has been stored in the endpoint FIFO. When it
is copied from FIFO, this bit is cleared which 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 may cause the accessing FIFO
corrupt, which will make the data loss.

Fixes: 914a3f3b3754 (USB: add atmel_usba_udc driver)
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/gadget/atmel_usba_udc.c