Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee139...
[sfrench/cifs-2.6.git] / drivers / firewire / ohci.c
index ccf52368a073ecf0518b946853a8f7980087d8f1..45c048751f3bd8a9527631d26673cc7f603fe85e 100644 (file)
@@ -1128,7 +1128,13 @@ static int context_add_buffer(struct context *ctx)
                return -ENOMEM;
 
        offset = (void *)&desc->buffer - (void *)desc;
-       desc->buffer_size = PAGE_SIZE - offset;
+       /*
+        * Some controllers, like JMicron ones, always issue 0x20-byte DMA reads
+        * for descriptors, even 0x10-byte ones. This can cause page faults when
+        * an IOMMU is in use and the oversized read crosses a page boundary.
+        * Work around this by always leaving at least 0x10 bytes of padding.
+        */
+       desc->buffer_size = PAGE_SIZE - offset - 0x10;
        desc->buffer_bus = bus_addr + offset;
        desc->used = 0;