Commit 8165e34bf4f1b663ca37f7ead4bb029b4d9da74e
Committed by
Marek Vasut
1 parent
2456b97f0c
Exists in
v2017.01-smarct4x
and in
48 other branches
usb: ehci: fully align interrupt QHs/QTDs
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>
Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff
drivers/usb/host/ehci-hcd.c
... | ... | @@ -1162,14 +1162,16 @@ |
1162 | 1162 | debug("ehci intr queue: out of memory\n"); |
1163 | 1163 | goto fail1; |
1164 | 1164 | } |
1165 | - result->first = memalign(32, sizeof(struct QH) * queuesize); | |
1165 | + result->first = memalign(USB_DMA_MINALIGN, | |
1166 | + sizeof(struct QH) * queuesize); | |
1166 | 1167 | if (!result->first) { |
1167 | 1168 | debug("ehci intr queue: out of memory\n"); |
1168 | 1169 | goto fail2; |
1169 | 1170 | } |
1170 | 1171 | result->current = result->first; |
1171 | 1172 | result->last = result->first + queuesize - 1; |
1172 | - result->tds = memalign(32, sizeof(struct qTD) * queuesize); | |
1173 | + result->tds = memalign(USB_DMA_MINALIGN, | |
1174 | + sizeof(struct qTD) * queuesize); | |
1173 | 1175 | if (!result->tds) { |
1174 | 1176 | debug("ehci intr queue: out of memory\n"); |
1175 | 1177 | goto fail3; |