提交 82341b36 编写于 作者: A Anton Vorontsov 提交者: Greg Kroah-Hartman

USB: fsl_qe_udc: Fix muram corruption by disabled endpoints

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: NAnton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 ef84e405
...@@ -1622,6 +1622,7 @@ static int qe_ep_disable(struct usb_ep *_ep) ...@@ -1622,6 +1622,7 @@ static int qe_ep_disable(struct usb_ep *_ep)
nuke(ep, -ESHUTDOWN); nuke(ep, -ESHUTDOWN);
ep->desc = NULL; ep->desc = NULL;
ep->stopped = 1; ep->stopped = 1;
qe_ep_reset(udc, ep->epnum);
spin_unlock_irqrestore(&udc->lock, flags); spin_unlock_irqrestore(&udc->lock, flags);
cpm_muram_free(cpm_muram_offset(ep->rxbase)); cpm_muram_free(cpm_muram_offset(ep->rxbase));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册