]> git.sur5r.net Git - u-boot/commitdiff
usb: ehci: fully align interrupt QHs/QTDs
authorStephen Warren <swarren@nvidia.com>
Thu, 6 Feb 2014 20:13:06 +0000 (13:13 -0700)
committerMarek Vasut <marex@denx.de>
Mon, 10 Mar 2014 17:53:36 +0000 (18:53 +0100)
These data structures are passed to cache-flushing routines, and hence
must be conform to both the USB the cache-flusing alignment requirements.
That means aligning to USB_DMA_MINALIGN. This is important on systems
where cache lines are >32 bytes.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
drivers/usb/host/ehci-hcd.c

index 7068b762d8a459536d565e5b6c4057ff3fa842d2..6017090ebeec93092953cc53266cd6de4a745dc7 100644 (file)
@@ -1162,14 +1162,16 @@ create_int_queue(struct usb_device *dev, unsigned long pipe, int queuesize,
                debug("ehci intr queue: out of memory\n");
                goto fail1;
        }
-       result->first = memalign(32, sizeof(struct QH) * queuesize);
+       result->first = memalign(USB_DMA_MINALIGN,
+                                sizeof(struct QH) * queuesize);
        if (!result->first) {
                debug("ehci intr queue: out of memory\n");
                goto fail2;
        }
        result->current = result->first;
        result->last = result->first + queuesize - 1;
-       result->tds = memalign(32, sizeof(struct qTD) * queuesize);
+       result->tds = memalign(USB_DMA_MINALIGN,
+                              sizeof(struct qTD) * queuesize);
        if (!result->tds) {
                debug("ehci intr queue: out of memory\n");
                goto fail3;