usb: ci13xxx_udc: unmap req DMA buffers upon cable disconnection

Device controller driver transfers the ownership of usb request buffer
memory to device DMA by making call to dma_map_single. CPU regains the
access only after making call to dma_unmap_single.
Upon request completion USB driver is performing dma_unmap_single and
accessing the memory.
Perform dma_unmap_single upon cable disconnect also while flushing the USB
requests.

Change-Id: Ic180c2b1158c93c5b187607c364f0fd5056cc52f
CRs-fixed: 327466
Signed-off-by: Anji jonnala <anjir@codeaurora.org>
This commit is contained in:
Anji jonnala
2011-12-26 16:39:53 +05:30
parent 4229da52d1
commit ea7bbc32e1

View File

@@ -1844,6 +1844,14 @@ __acquires(mEp->lock)
}
mReq->req.status = -ESHUTDOWN;
if (mReq->map) {
dma_unmap_single(mEp->device, mReq->req.dma,
mReq->req.length,
mEp->dir ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
mReq->req.dma = 0;
mReq->map = 0;
}
if (mReq->req.complete != NULL) {
spin_unlock(mEp->lock);
if ((mEp->type == USB_ENDPOINT_XFER_CONTROL) &&