|
|
@@ -104,7 +104,6 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size,
|
|
|
struct page *page;
|
|
|
void *addr;
|
|
|
|
|
|
- size = PAGE_ALIGN(size);
|
|
|
page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT,
|
|
|
get_order(size));
|
|
|
if (!page)
|
|
|
@@ -193,6 +192,8 @@ static void __dma_free(struct device *dev, size_t size,
|
|
|
{
|
|
|
void *swiotlb_addr = phys_to_virt(dma_to_phys(dev, dma_handle));
|
|
|
|
|
|
+ size = PAGE_ALIGN(size);
|
|
|
+
|
|
|
if (!is_device_dma_coherent(dev)) {
|
|
|
if (__free_from_pool(vaddr, size))
|
|
|
return;
|