[PATCH 3/3] usb: musb: unmap buffers if forced to use pio mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For rx transfers, if dma code can not handle a usb request due to alignment or
size threshold, buffers must be unmapped before calling musb_read_fifo(). This
is important for platforms with outer-cache due to the following patch:

	commit 2ffe2da3e71652d4f4cae19539b5c78c2a239136
	Author: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
	Date:   Sat Oct 31 16:52:16 2009 +0000

		ARM: dma-mapping: fix for speculative prefetching

Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@xxxxxxxxxxxxxx>
---
This patch is based on git://gitorious.org/usb/usb.git musb-hw

 drivers/usb/musb/musb_gadget.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 7ee8467..238f656 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -765,6 +765,10 @@ static void rxstate(struct musb *musb, struct musb_request *req)
 					return;
 			}
 #endif
+			/* Some how DMA is not possible. Unmap
+			 * buffers before continuing with PIO mode.
+			 */
+			musb_dma_unmap_request(musb, req);
 
 			musb_read_fifo(musb_ep->hw_ep, fifo_count, (u8 *)
 					(request->buf + request->actual));
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux