All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Sakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org
Cc: mchehab@osg.samsung.com
Subject: Re: [REVIEW PATCH FOR v3.19 1/1] vb2: Fix dma_dir setting for dma-contig mem type
Date: Fri, 13 Feb 2015 09:56:58 +0100	[thread overview]
Message-ID: <54DDBC5A.8020905@xs4all.nl> (raw)
In-Reply-To: <1423813357-31446-1-git-send-email-sakari.ailus@linux.intel.com>

On 02/13/2015 08:42 AM, Sakari Ailus wrote:
> The last argument of vb2_dc_get_user_pages() is of type enum
> dma_data_direction, but the caller, vb2_dc_get_userptr() passes a value
> which is the result of comparison dma_dir == DMA_FROM_DEVICE. This results
> in the write parameter to get_user_pages() being zero in all cases, i.e.
> that the caller has no intent to write there.
> 
> This was broken by patch "vb2: replace 'write' by 'dma_dir'".
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Yuck.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> ---
>  drivers/media/v4l2-core/videobuf2-dma-contig.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c
> index b481d20..69e0483 100644
> --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
> +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
> @@ -632,8 +632,7 @@ static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr,
>  	}
>  
>  	/* extract page list from userspace mapping */
> -	ret = vb2_dc_get_user_pages(start, pages, n_pages, vma,
> -				    dma_dir == DMA_FROM_DEVICE);
> +	ret = vb2_dc_get_user_pages(start, pages, n_pages, vma, dma_dir);
>  	if (ret) {
>  		unsigned long pfn;
>  		if (vb2_dc_get_user_pfn(start, n_pages, vma, &pfn) == 0) {
> 


      parent reply	other threads:[~2015-02-13  8:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13  7:42 [REVIEW PATCH FOR v3.19 1/1] vb2: Fix dma_dir setting for dma-contig mem type Sakari Ailus
2015-02-13  8:09 ` Sakari Ailus
2015-02-13  8:56 ` Hans Verkuil [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54DDBC5A.8020905@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.