On (20/11/25 23:19), Ricardo Ribalda wrote:
[..]
> +     if (uvc_urb->pages)
> +             dma_sync_sgtable_for_device(stream_to_dmadev(uvc_urb->stream),
> +                                         &uvc_urb->sgt, DMA_FROM_DEVICE);

[..]

> +     if (uvc_urb->pages)
> +             dma_sync_sgtable_for_cpu(stream_to_dmadev(stream),
> +                                      &uvc_urb->sgt, DMA_FROM_DEVICE);

[..]

> +     uvc_urb->pages = dma_alloc_noncontiguous(dma_dev, stream->urb_size,
> +                                              &uvc_urb->dma,
> +                                              gfp_flags | __GFP_NOWARN, 0);

Do we need to pass __GFP_NOWARN? It seems that

dma_alloc_noncontiguous()
  __iommu_dma_alloc_noncontiguous()
    __iommu_dma_alloc_pages()

does this internally.

> +     if (!uvc_urb->pages)
> +             return false;
> +
> +     uvc_urb->buffer = vmap(uvc_urb->pages,
> +                            PAGE_ALIGN(stream->urb_size) >> PAGE_SHIFT,
> +                            VM_DMA_COHERENT, PAGE_KERNEL);

This is not related to Ricardo's patch, just a side note:

  I think VM_DMA_COHERENT needs to be renamed. I found it a bit confusing
  to see DMA_COHERENT mapping being dma_sync-ed. It turned out that the
  flag has different meaning.

        -ss
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to