Re: [PATCH 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API

From: Christoph Hellwig
Date: Mon Feb 01 2021 - 11:38:15 EST


On Thu, Jan 28, 2021 at 06:00:57PM +0100, Ricardo Ribalda wrote:
> > Given that we vmap the addresses this also needs
> > flush_kernel_vmap_range / invalidate_kernel_vmap_range calls for
> > VIVT architectures.
>
> We only read from the device to the cpu. Then can we run only
> invalidate_kernel_vmap_range() ?
>
> something like ?
> else {
> dma_sync_sgtable_for_cpu(dma_dev, uvc_urb->sgt, DMA_FROM_DEVICE);
> invalidate_kernel_vmap_range(uvc_urb->buffer,
> uvc_urb->stream->urb_size );
> }

Yes. Right now we don't have a proper state machine for the
*_kernel_vmap_range, but we should probably add one once usage of this
grows. Until then I need to respin my API patch to document how callers
need to use *_kernel_vmap_range, as well as adding the so far missing
dma-debug support.

As we're getting toward the end of the merge window I'll try to get this
done ASAP.

How should we plan to merge this code? Do you have a tree you'd like
to pick up the whole thing for? Or should I create a dma-mapping
tree branch that can be pulled in?