usb: chipidea: need to mask when writting endptflush and endptprime
authorMatthieu CASTET <matthieu.castet@parrot.com>
Wed, 19 Feb 2014 05:46:31 +0000 (13:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 05:30:10 +0000 (21:30 -0800)
commit4ebd08982393e092b7dbcb19b68c7de252c98988
tree54945187c769dfd51558b27d00408091cdb2a866
parent2551dadbe3a4c652d544068c64b540162ffba27b
usb: chipidea: need to mask when writting endptflush and endptprime

commit 5bf5dbeda2454296f1984adfbfc8e6f5965ac389 upstream.

ENDPTFLUSH and ENDPTPRIME registers are set by software and clear
by hardware. There is a bit for each endpoint. When we are setting
a bit for an endpoint we should make sure we do not touch other
endpoint bit. There is a race condition if the hardware clear the
bit between the read and the write in hw_write.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
Tested-by: Michael Grzeschik <mgrzeschik@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/udc.c