public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hansverk@cisco.com>
To: Tomasz Stanislawski <t.stanislaws@samsung.com>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	linux-media@vger.kernel.org
Cc: pawel@osciak.com, sakari.ailus@iki.fi, m.szyprowski@samsung.com,
	s.nawrocki@samsung.com, Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [REVIEWv3 PATCH 09/13] vb2: add vb2_fileio_is_active and check it more often
Date: Fri, 11 Apr 2014 15:22:14 +0200	[thread overview]
Message-ID: <5347EC86.5070004@cisco.com> (raw)
In-Reply-To: <5347E894.5010401@samsung.com>

On 04/11/2014 03:05 PM, Tomasz Stanislawski wrote:
> Hi Hans,
> 
> On 04/11/2014 10:11 AM, Hans Verkuil wrote:
>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> Added a vb2_fileio_is_active inline function that returns true if fileio
>> is in progress. Check for this too in mmap() (you don't want apps mmap()ing
>> buffers used by fileio) and expbuf() (same reason).
> 
> Why? I expect that there is no sane use case for using
> mmap() and expbuf in read/write mode but why forbidding this.
> 
> Could you provide a reason?

The buffer management is completely internal to vb2 for read()/write().
I think that allowing expbuf/mmap is just plain weird. I don't think
it would do any harm other than increasing the memory refcount, but
I very much prefer to block this.

The only ioctl allowed is querybuf, and that primarily for debugging.
Frankly, I wouldn't mind if that is blocked off as well but since it
is guaranteed to have no side-effects and it actually has a use-case
(debugging) I've left that in.

Personally I think the question is not: "why block this?", it is:
"why would you allow it?".

Regards,

	Hans

  reply	other threads:[~2014-04-11 13:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11  8:11 [REVIEWv3 PATCH 00/13] vb2: various small fixes/improvements Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 01/13] vb2: stop_streaming should return void Hans Verkuil
2014-04-16 21:38   ` Mauro Carvalho Chehab
2014-04-17  2:26     ` Mauro Carvalho Chehab
2014-04-11  8:11 ` [REVIEWv3 PATCH 02/13] vb2: fix handling of data_offset and v4l2_plane.reserved[] Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 03/13] vb2: if bytesused is 0, then fill with output buffer length Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 04/13] vb2: use correct prefix Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 05/13] vb2: move __qbuf_mmap before __qbuf_userptr Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 06/13] vb2: set timestamp when using write() Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 07/13] vb2: reject output buffers with V4L2_FIELD_ALTERNATE Hans Verkuil
2014-04-11  8:42   ` Archit Taneja
2014-04-11  8:58     ` Hans Verkuil
2014-04-11  9:02       ` Archit Taneja
2014-04-11  8:11 ` [REVIEWv3 PATCH 08/13] vb2: simplify a confusing condition Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 09/13] vb2: add vb2_fileio_is_active and check it more often Hans Verkuil
2014-04-11 13:05   ` Tomasz Stanislawski
2014-04-11 13:22     ` Hans Verkuil [this message]
2014-04-11  8:11 ` [REVIEWv3 PATCH 10/13] vb2: allow read/write as long as the format is single planar Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 11/13] vb2: start messages with a lower-case for consistency Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 12/13] DocBook media: update bytesused field description Hans Verkuil
2014-04-11  8:11 ` [REVIEWv3 PATCH 13/13] v4l2-pci-skeleton.c: fix alternate field handling Hans Verkuil
2014-04-11  9:39 ` [REVIEWv3 PATCH 00/13] vb2: various small fixes/improvements Sakari Ailus

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=5347EC86.5070004@cisco.com \
    --to=hansverk@cisco.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sakari.ailus@iki.fi \
    --cc=t.stanislaws@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox