Re: [PATCH v2] lib/scatterlist: Provide a DMA page iterator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 07, 2019 at 03:26:47PM -0700, Jason Gunthorpe wrote:
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
> index 31786b200afc47..e84f6aaee778f0 100644
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
> @@ -311,7 +311,13 @@ static dma_addr_t __vmw_piter_dma_addr(struct vmw_piter *viter)
>  
>  static dma_addr_t __vmw_piter_sg_addr(struct vmw_piter *viter)
>  {
> -	return sg_page_iter_dma_address(&viter->iter);
> +	/*
> +	 * FIXME: This driver wrongly mixes DMA and CPU SG list iteration and
> +	 * needs revision. See
> +	 * https://lore.kernel.org/lkml/20190104223531.GA1705@xxxxxxxx/
> +	 */
> +	return sg_page_iter_dma_address(
> +		(struct sg_dma_page_iter *)&viter->iter);

Occured to me this would be better written as:

	return sg_page_iter_dma_address(
		container_of(&viter->iter, struct sg_dma_page_iter, base));

Since I think we are done with this now I'll fix it when I apply this
patch

Thanks for all the acks everyone

Regards,
Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux