public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
To: Arnout Vandecappelle <arnout@mind.be>
Cc: linux-media@vger.kernel.org, mchehab@infradead.org
Subject: Re: [PATCH 1/2] V4L/DVB: buf-dma-sg.c: don't assume nr_pages == sglen
Date: Wed, 17 Mar 2010 22:57:18 +0200	[thread overview]
Message-ID: <4BA1422E.4030601@maxwell.research.nokia.com> (raw)
In-Reply-To: <1267718451-24961-2-git-send-email-arnout@mind.be>

Hi Arnout,

Arnout Vandecappelle wrote:
> videobuf_pages_to_sg() and videobuf_vmalloc_to_sg() happen to create
> a scatterlist element for every page.  However, this is not true for
> bus addresses, so other functions shouldn't rely on the length of the
> scatter list being equal to nr_pages.
> ---
>  drivers/media/video/videobuf-dma-sg.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c
> index da1790e..3b6f1b8 100644
> --- a/drivers/media/video/videobuf-dma-sg.c
> +++ b/drivers/media/video/videobuf-dma-sg.c
> @@ -244,7 +244,7 @@ int videobuf_dma_map(struct videobuf_queue* q, struct videobuf_dmabuf *dma)
>  	}
>  	if (!dma->bus_addr) {
>  		dma->sglen = dma_map_sg(q->dev, dma->sglist,
> -					dma->nr_pages, dma->direction);
> +					dma->sglen, dma->direction);
>  		if (0 == dma->sglen) {
>  			printk(KERN_WARNING
>  			       "%s: videobuf_map_sg failed\n",__func__);

Where is dma->sglen actually set?

videobuf_dma_map() is used in __videobuf_iolock
(drivers/media/video/videobuf-dma-sg.c) but neither
videobuf_dma_init_kernel() nor videobuf_dma_init_user() seem to set it.
This apparently leaves the value uninitialised.

I definitely think it should be assigned somewhere. :-)

-- 
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com

  reply	other threads:[~2010-03-17 20:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 14:12 Support for zerocopy to DSP on OMAP3 Arnout Vandecappelle
2010-03-03 19:11 ` [PATCH RFCv1] " Arnout Vandecappelle
2010-03-04  9:52   ` Laurent Pinchart
2010-03-04 16:00 ` [PATCHv2] " Arnout Vandecappelle
2010-03-04 16:00 ` [PATCH 1/2] V4L/DVB: buf-dma-sg.c: don't assume nr_pages == sglen Arnout Vandecappelle
2010-03-17 20:57   ` Sakari Ailus [this message]
2010-03-17 22:50     ` Arnout Vandecappelle
2010-03-04 16:00 ` [PATCH 2/2] V4L/DVB: buf-dma-sg.c: support non-pageable user-allocated memory Arnout Vandecappelle
  -- strict thread matches above, loose matches on Subject: below --
2010-03-17 22:53 [PATCH v3] Support for zerocopy to DMA buffers Arnout Vandecappelle
2010-03-17 22:53 ` [PATCH 1/2] V4L/DVB: buf-dma-sg.c: don't assume nr_pages == sglen Arnout Vandecappelle
2010-03-24  5:43   ` Sakari Ailus
2010-03-30 10:27     ` Arnout Vandecappelle

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=4BA1422E.4030601@maxwell.research.nokia.com \
    --to=sakari.ailus@maxwell.research.nokia.com \
    --cc=arnout@mind.be \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox