]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: The trb_address_map radix tree expects 1KB segment memory aligment
authorHans de Goede <hdegoede@redhat.com>
Tue, 5 Nov 2013 14:50:03 +0000 (15:50 +0100)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 4 Mar 2014 23:38:14 +0000 (15:38 -0800)
commit08cffa718e74c06c9ec66cbb98119b03786f15be
tree20a93c606bf709a6a364ff3b25945c63ecbac8af
parent08ffe4d8da1ee698d0e652788cf2fbab638a249f
xhci: The trb_address_map radix tree expects 1KB segment memory aligment

If we align segment dma pool memory to 64 bytes, then a segment can be located
at 0x10000040 - 0x1000043f, and a segment from another ring at 0x10000440 -
0x1000083f. The last trb in the first segment at 0x10000430 will then translate
to the same radix tree key as the first trb of the second segment, while they
are in different rings!

This patches fixes this by changing the alignment of the dma pool to be 1KB
rather then 64 bytes. An alternative fix would be to reduce the shift used
to calculate the radix tree keys, but that would (slighlty) grow the radix
trees so I believe this is the better fix.

Note this patch is mostly theoretical since in practice I've not seen
the dma_pool actually return not 1KB aligned memory.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci-mem.c