On Thu, Aug 08, 2019 at 09:10:15AM -0700, Christoph Hellwig wrote:
> On Thu, Aug 08, 2019 at 10:46:36AM +0200, [email protected] 
> wrote:
> > --- a/drivers/usb/core/devio.c
> > +++ b/drivers/usb/core/devio.c
> > @@ -238,9 +238,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 */
> 
> Doing the dma_mmap_coherent unconditionally is the right thing here.
> Gavin who is on Cc has been looking into that.

Ok, tht is assuming it always is dma_alloc_* memory which apparently
it isn't.  But the arch ifdef for sure is wrong.

Reply via email to