Loading arch/arm64/mm/dma-mapping.c +8 −4 Original line number Original line Diff line number Diff line Loading @@ -294,16 +294,20 @@ static void *arm64_swiotlb_alloc_noncoherent(struct device *dev, size_t size, /* remove any dirty cache lines on the kernel alias */ /* remove any dirty cache lines on the kernel alias */ __dma_flush_range(ptr, ptr + size); __dma_flush_range(ptr, ptr + size); map = kmalloc(sizeof(struct page *) << order, flags & ~GFP_DMA); map = kmalloc(sizeof(struct page *) << order, (flags & ~GFP_DMA) | __GFP_NOWARN); if (!map) { map = vmalloc(sizeof(struct page *) << order); if (!map) if (!map) goto no_map; goto no_map; } /* create a coherent mapping */ /* create a coherent mapping */ page = virt_to_page(ptr); page = virt_to_page(ptr); for (i = 0; i < (size >> PAGE_SHIFT); i++) for (i = 0; i < (size >> PAGE_SHIFT); i++) map[i] = page + i; map[i] = page + i; coherent_ptr = vmap(map, size >> PAGE_SHIFT, VM_MAP, prot); coherent_ptr = vmap(map, size >> PAGE_SHIFT, VM_MAP, prot); kfree(map); kvfree(map); if (!coherent_ptr) if (!coherent_ptr) goto no_map; goto no_map; } } Loading Loading
arch/arm64/mm/dma-mapping.c +8 −4 Original line number Original line Diff line number Diff line Loading @@ -294,16 +294,20 @@ static void *arm64_swiotlb_alloc_noncoherent(struct device *dev, size_t size, /* remove any dirty cache lines on the kernel alias */ /* remove any dirty cache lines on the kernel alias */ __dma_flush_range(ptr, ptr + size); __dma_flush_range(ptr, ptr + size); map = kmalloc(sizeof(struct page *) << order, flags & ~GFP_DMA); map = kmalloc(sizeof(struct page *) << order, (flags & ~GFP_DMA) | __GFP_NOWARN); if (!map) { map = vmalloc(sizeof(struct page *) << order); if (!map) if (!map) goto no_map; goto no_map; } /* create a coherent mapping */ /* create a coherent mapping */ page = virt_to_page(ptr); page = virt_to_page(ptr); for (i = 0; i < (size >> PAGE_SHIFT); i++) for (i = 0; i < (size >> PAGE_SHIFT); i++) map[i] = page + i; map[i] = page + i; coherent_ptr = vmap(map, size >> PAGE_SHIFT, VM_MAP, prot); coherent_ptr = vmap(map, size >> PAGE_SHIFT, VM_MAP, prot); kfree(map); kvfree(map); if (!coherent_ptr) if (!coherent_ptr) goto no_map; goto no_map; } } Loading