On Wed, Jul 23, 2014 at 02:35:06AM +0100, Laura Abbott wrote: > +void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags) > +{ > + struct vm_struct *area = find_vm_area(cpu_addr); > + > + if (!area || (area->flags & vm_flags) != vm_flags) { > + WARN(1, "trying to free invalid coherent area: %p\n", cpu_addr); > + return; > + } > + > + unmap_kernel_range((unsigned long)cpu_addr, size); > + vunmap(cpu_addr); > +} One more thing - is unmap_kernel_range() needed here? vunmap() ends up calling vunmap_page_range(), same as unmap_kernel_range(). I think one difference is that in the vunmap case, TLB flushing is done lazily. -- Catalin -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>