[PATCH] ohci-hcd: use dma_flush/inv_range to allow using the driver with enabled MMU

Jan Luebbe jlu at pengutronix.de
Mon May 14 04:39:29 EDT 2012


Signed-off-by: Jan Luebbe <jlu at pengutronix.de>
---
 drivers/usb/host/ohci-hcd.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index f103101..05e4094 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -859,6 +859,8 @@ static void td_fill(struct ohci *ohci, unsigned int info,
 
 	td->hwNextTD = virt_to_phys((void *)m32_swap((unsigned long)td_pt));
 
+	dma_flush_range((unsigned long)data, (unsigned long)(data + len));
+
 	/* append to queue */
 	td->ed->hwTailP = td->hwNextTD;
 }
@@ -1555,6 +1557,8 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 	dev->status = stat;
 	dev->act_len = urb->actual_length;
 
+	dma_inv_range((unsigned long)buffer, (unsigned long)(buffer + transfer_len));
+
 	pkt_print(urb, dev, pipe, buffer, transfer_len,
 		  setup, "RET(ctlr)", usb_pipein(pipe));
 
-- 
1.7.9.5




More information about the barebox mailing list