Message ID | 20190727135759.GA19217@priv-mua.localdomain (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | usb zero copy dma handling | expand |
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index ffccd40ea67d..0fedf4a97f65 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -240,9 +240,14 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma) usbm->vma_use_count = 1; INIT_LIST_HEAD(&usbm->memlist); +#ifdef CONFIG_X86 if (remap_pfn_range(vma, vma->vm_start, virt_to_phys(usbm->mem) >> PAGE_SHIFT, size, vma->vm_page_prot) < 0) { +#else /* !CONFIG_X86 */ + if (dma_mmap_coherent(ps->dev->bus->sysdev, + vma, mem, dma_handle, size) < 0) { +#endif /* !CONFIG_X86 */ dec_usb_memory_use_count(usbm, &usbm->vma_use_count); return -EAGAIN; }