[PATCH 4/9] USB ehci: Use dma coherent buffers for qh/qtd
Sascha Hauer
s.hauer at pengutronix.de
Thu Jun 21 05:55:12 EDT 2012
There's no point in syncing them manually. Instead, use
dma_alloc_coherent and skip the manual flushing/invalidating.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/usb/host/ehci-hcd.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index a2473a9..425406d 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -148,9 +148,6 @@ static void cache_qh(struct ehci_priv *ehci, int flush)
{
int i;
- flush_invalidate(ehci->qh_list, sizeof(struct QH) * NUM_QH, flush);
- flush_invalidate(ehci->td, sizeof(struct qTD) * NUM_TD, flush);
-
for (i = 0; i < NUM_TD; i ++)
cache_qtd(&ehci->td[i], flush);
}
@@ -878,8 +875,8 @@ static int ehci_probe(struct device_d *dev)
ehci->hccr = dev_request_mem_region(dev, 0);
ehci->hcor = dev_request_mem_region(dev, 1);
- ehci->qh_list = xmemalign(32, sizeof(struct QH) * NUM_QH);
- ehci->td = xmemalign(32, sizeof(struct qTD) * NUM_TD);
+ ehci->qh_list = dma_alloc_coherent(sizeof(struct QH) * NUM_TD);
+ ehci->td = dma_alloc_coherent(sizeof(struct qTD) * NUM_TD);
host->init = ehci_init;
host->submit_int_msg = submit_int_msg;
--
1.7.10
More information about the barebox
mailing list