]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
USB: fsl_qe_udc: Fix muram corruption by disabled endpoints
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Thu, 25 Dec 2008 14:15:11 +0000 (17:15 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 Feb 2009 19:19:47 +0000 (11:19 -0800)
Before freeing an endpoint's muram memory, we should stop all activity
of the endpoint, otherwise the QE UDC controller might do nasty things
with the muram memory that isn't belong to that endpoint anymore.

The qe_ep_reset() effectively flushes the hardware fifos, finishes all
late transaction and thus prevents the corruption.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/fsl_qe_udc.c

index 7a820a3b4acd60cac7a34653438e64ec7b77485a..32f415ebd3df20d21775645a68d3a55509455bd5 100644 (file)
@@ -1622,6 +1622,7 @@ static int qe_ep_disable(struct usb_ep *_ep)
        nuke(ep, -ESHUTDOWN);
        ep->desc = NULL;
        ep->stopped = 1;
+       qe_ep_reset(udc, ep->epnum);
        spin_unlock_irqrestore(&udc->lock, flags);
 
        cpm_muram_free(cpm_muram_offset(ep->rxbase));