[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190208163813.GC25136@mellanox.com>
Date: Fri, 8 Feb 2019 16:38:19 +0000
From: Jason Gunthorpe <jgg@...lanox.com>
To: Daniel Stone <daniel@...ishbar.org>, "hch@....de" <hch@....de>,
"Koenig, Christian" <Christian.Koenig@....com>,
Thomas Hellstrom <thellstrom@...are.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"yong.zhi@...el.com" <yong.zhi@...el.com>,
"daniel.vetter@...ll.ch" <daniel.vetter@...ll.ch>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
"bingbu.cao@...el.com" <bingbu.cao@...el.com>,
"tian.shu.qiu@...el.com" <tian.shu.qiu@...el.com>,
"shiraz.saleem@...el.com" <shiraz.saleem@...el.com>,
"sakari.ailus@...ux.intel.com" <sakari.ailus@...ux.intel.com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v2] lib/scatterlist: Provide a DMA page iterator
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@ziepe.ca/
> + */
> + 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
Powered by blists - more mailing lists