Commit 3fc0a7c3 authored by Mian Yousaf Kaukab's avatar Mian Yousaf Kaukab Committed by Felipe Balbi

usb: gadget: net2280: unconditionally reset dma in usb_reset

If ep->dma is set, abort_dma() takes care of dma clean-up. If ep->dma
is not set, unconditionally reset dma channel.
Tested-by: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: default avatarMian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent e6ac4bb0
...@@ -1979,9 +1979,15 @@ static void usb_reset_338x(struct net2280 *dev) ...@@ -1979,9 +1979,15 @@ static void usb_reset_338x(struct net2280 *dev)
/* clear old dma and irq state */ /* clear old dma and irq state */
for (tmp = 0; tmp < 4; tmp++) { for (tmp = 0; tmp < 4; tmp++) {
struct net2280_ep *ep = &dev->ep[tmp + 1]; struct net2280_ep *ep = &dev->ep[tmp + 1];
struct net2280_dma_regs __iomem *dma;
if (ep->dma) if (ep->dma) {
abort_dma(ep); abort_dma(ep);
} else {
dma = &dev->dma[tmp];
writel(BIT(DMA_ABORT), &dma->dmastat);
writel(0, &dma->dmactl);
}
} }
writel(~0, &dev->regs->irqstat0), writel(~0, &dev->regs->irqstat1); writel(~0, &dev->regs->irqstat0), writel(~0, &dev->regs->irqstat1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment