public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Andy Walls <awalls@md.metrocast.net>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	linux-media@vger.kernel.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Pawel Osciak <pawel@osciak.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [RFCv3 PATCH 12/18] vb2_poll: don't start DMA, leave that to the first read().
Date: Tue, 28 Jun 2011 09:43:22 -0300	[thread overview]
Message-ID: <4E09CC6A.8080900@redhat.com> (raw)
In-Reply-To: <cd2c9732-aee5-492b-ade2-bee084f79739@email.android.com>

Em 28-06-2011 09:21, Andy Walls escreveu:
> Mauro Carvalho Chehab <mchehab@redhat.com> wrote:

>> I'm not very comfortable with vb2 returning unexpected errors there.
>> Also,
>> for me it is clear that, if read will fail, POLLERR should be rised.
>>
>> Mauro. 
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media"
>> in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> It is also the case that a driver's poll method should never sleep.

True.

> I will try to find the conversation I had with laurent on interpreting the POSIX spec on error returns from select() and poll().  I will also try to find links to previos discussion with Hans on this.
> 
> One issue is how to start streaming with apps that:
> - Open /dev/video/ in a nonblocking mode, and
> - Use the read() method
> 
> while doing it in a way that is POSIX compliant and doesn't break existing apps.  

Well, a first call for poll() may rise a thread that will prepare the buffers, and
return with 0 while there's no data available.

> The other constraint is to ensure when only poll()-ing for exception conditions, not having significant IO side effects.
> 
> I'm pretty sure sleeping in a driver's poll() method, or having significant side effects, is not ine the spirit of the POSIX select() and poll(), even if the letter of POSIX says nothing about it.
> 
> The method I suggested to Hans is completely POSIX compliant for apps using read() and select() and was checked against MythTV as having no bad side effects.  (And by thought experiment doesn't break any sensible app using nonblocking IO with select() and read().)
> 
> I did not do analysis for apps that use mmap(), which I guess is the current concern.

The concern is that it is pointing that there are available data, even when there is an error.
This looks like a POSIX violation for me.

Cheers,
Mauro.

  reply	other threads:[~2011-06-28 12:43 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 15:05 [RFCv3 PATCH 00/18] Add Control Event and autofoo/foo support Hans Verkuil
2011-06-07 15:05 ` [RFCv3 PATCH 01/18] v4l2-ctrls: introduce call_op define Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 02/18] v4l2-ctrls: simplify error_idx handling Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 03/18] v4l2-ctrls: drivers should be able to ignore the READ_ONLY flag Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 04/18] v4l2-ioctl: add ctrl_handler to v4l2_fh Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 05/18] v4l2-subdev: implement per-filehandle control handlers Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 06/18] v4l2-ctrls: fix and improve volatile control handling Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 07/18] v4l2-controls.txt: update to latest v4l2-ctrl.c changes Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 08/18] v4l2-ctrls: add v4l2_ctrl_auto_cluster to simplify autogain/gain scenarios Hans Verkuil
2011-06-20 13:05     ` Laurent Pinchart
2011-06-20 13:16       ` Hans Verkuil
2011-06-27 20:57     ` Mauro Carvalho Chehab
2011-06-28  6:08       ` Hans Verkuil
2011-06-28 10:25         ` Mauro Carvalho Chehab
2011-06-27 21:10     ` Mauro Carvalho Chehab
2011-06-28  6:11       ` Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 09/18] DocBook: Improve cluster documentation and document the new autoclusters Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 10/18] vivi: add autogain/gain support to test the autocluster functionality Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 11/18] v4l2-ctrls: add v4l2_fh pointer to the set control functions Hans Verkuil
2011-06-27 21:20     ` Mauro Carvalho Chehab
2011-06-28  6:22       ` Hans Verkuil
2011-06-28 10:27         ` Mauro Carvalho Chehab
2011-06-07 15:05   ` [RFCv3 PATCH 12/18] vb2_poll: don't start DMA, leave that to the first read() Hans Verkuil
2011-06-27 21:52     ` Mauro Carvalho Chehab
2011-06-28  7:33       ` Hans Verkuil
2011-06-28  9:01         ` Hans Verkuil
2011-06-28 11:20         ` Mauro Carvalho Chehab
2011-06-28 12:21           ` Andy Walls
2011-06-28 12:43             ` Mauro Carvalho Chehab [this message]
2011-06-28 13:58               ` Hans Verkuil
2011-06-29  6:30                 ` Hans Verkuil
2011-06-28 23:14               ` Andy Walls
2011-06-29  0:00                 ` Mauro Carvalho Chehab
2011-06-29  5:08                   ` Andy Walls
2011-06-29 11:37                     ` Mauro Carvalho Chehab
2011-06-07 15:05   ` [RFCv3 PATCH 13/18] v4l2-ctrls: add control events Hans Verkuil
2011-06-20 13:33     ` Laurent Pinchart
2011-06-07 15:05   ` [RFCv3 PATCH 14/18] v4l2-ctrls: simplify event subscription Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 15/18] V4L2 spec: document control events Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 16/18] vivi: support " Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 17/18] ivtv: add control event support Hans Verkuil
2011-06-07 15:05   ` [RFCv3 PATCH 18/18] v4l2-compat-ioctl32: add VIDIOC_DQEVENT support Hans Verkuil

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=4E09CC6A.8080900@redhat.com \
    --to=mchehab@redhat.com \
    --cc=awalls@md.metrocast.net \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.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