[PATCH v2 09/18] drm/via: set FOLL_PIN via pin_user_pages_fast()

Jerome Glisse jglisse at redhat.com
Mon Nov 4 17:44:45 UTC 2019


On Sun, Nov 03, 2019 at 01:18:04PM -0800, John Hubbard wrote:
> Convert drm/via to use the new pin_user_pages_fast() call, which sets
> FOLL_PIN. Setting FOLL_PIN is now required for code that requires
> tracking of pinned pages, and therefore for any code that calls
> put_user_page().
> 
> Reviewed-by: Ira Weiny <ira.weiny at intel.com>
> Signed-off-by: John Hubbard <jhubbard at nvidia.com>

Please be more explicit that via_dmablit.c is already using put_user_page()
as i am expecting that any conversion to pin_user_pages*() must be pair with
a put_user_page(). I find above commit message bit unclear from that POV.

Reviewed-by: Jérôme Glisse <jglisse at redhat.com>


> ---
>  drivers/gpu/drm/via/via_dmablit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c
> index 3db000aacd26..37c5e572993a 100644
> --- a/drivers/gpu/drm/via/via_dmablit.c
> +++ b/drivers/gpu/drm/via/via_dmablit.c
> @@ -239,7 +239,7 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg,  drm_via_dmablit_t *xfer)
>  	vsg->pages = vzalloc(array_size(sizeof(struct page *), vsg->num_pages));
>  	if (NULL == vsg->pages)
>  		return -ENOMEM;
> -	ret = get_user_pages_fast((unsigned long)xfer->mem_addr,
> +	ret = pin_user_pages_fast((unsigned long)xfer->mem_addr,
>  			vsg->num_pages,
>  			vsg->direction == DMA_FROM_DEVICE ? FOLL_WRITE : 0,
>  			vsg->pages);
> -- 
> 2.23.0
> 



More information about the dri-devel mailing list