All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Schwarzott <zzam@gentoo.org>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	linux-media <linux-media@vger.kernel.org>
Cc: Junghak Sung <jh1009.sung@samsung.com>
Subject: Re: [PATCH for v4.5] vb2: fix nasty vb2_thread regression
Date: Wed, 27 Jan 2016 21:57:00 +0100	[thread overview]
Message-ID: <56A92F1C.9080005@gentoo.org> (raw)
In-Reply-To: <56A8B34A.7010606@xs4all.nl>

Am 27.01.2016 um 13:08 schrieb Hans Verkuil:
> The vb2_thread implementation was made generic and was moved from
> videobuf2-v4l2.c to videobuf2-core.c in commit af3bac1a. Unfortunately
> that clearly was never tested since it broke read() causing NULL address
> references.
> 
> The root cause was confused handling of vb2_buffer vs v4l2_buffer (the pb
> pointer in various core functions).
> 
> The v4l2_buffer no longer exists after moving the code into the core and
> it is no longer needed. However, the vb2_thread code passed a pointer to
> a vb2_buffer to the core functions were a v4l2_buffer pointer was expected
> and vb2_thread expected that the vb2_buffer fields would be filled in
> correctly.
> 
> This is obviously wrong since v4l2_buffer != vb2_buffer. Note that the
> pb pointer is a void pointer, so no type-checking took place.
> 
> This patch fixes this problem:
> 
> 1) allow pb to be NULL for vb2_core_(d)qbuf. The vb2_thread code will use
>    a NULL pointer here since they don't care about v4l2_buffer anyway.
> 2) let vb2_core_dqbuf pass back the index of the received buffer. This is
>    all vb2_thread needs: this index is the index into the q->bufs array
>    and vb2_thread just gets the vb2_buffer from there.
> 3) the fileio->b pointer (that originally contained a v4l2_buffer) is
>    removed altogether since it is no longer needed.
> 
> Tested with vivid and the cobalt driver.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
> Reported-by: Matthias Schwarzott <zzam@gentoo.org>

Hi Hans!

Thank you for this patch.
I gave this patch a try on the latest sources from
git://linuxtv.org/media_tree.git

Compiled for kernel 4.2.8 with media_build.

Now it no longer oopses.
It tunes fine (according to femon), but I still do not get a
picture/dvbtraffic reports nothing.

Regards
Matthias


  reply	other threads:[~2016-01-27 20:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 12:08 [PATCH for v4.5] vb2: fix nasty vb2_thread regression Hans Verkuil
2016-01-27 20:57 ` Matthias Schwarzott [this message]
2016-01-27 21:27   ` Hans Verkuil
2016-02-03 22:39     ` Mauro Carvalho Chehab

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=56A92F1C.9080005@gentoo.org \
    --to=zzam@gentoo.org \
    --cc=hverkuil@xs4all.nl \
    --cc=jh1009.sung@samsung.com \
    --cc=linux-media@vger.kernel.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 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.