linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yi Qingliang <niqingliang2003@gmail.com>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	mchehab@kernel.org, linux-media@vger.kernel.org,
	"for 4.14 and up" <stable@vger.kernel.org>
Subject: Re: [PATCH v3.16 2/2] v4l: event: Add subscription to list before calling "add" operation
Date: Thu, 3 Jan 2019 08:58:10 +0800	[thread overview]
Message-ID: <CADwFkYeFDgKvC5r6X4x-A73R1KwmPr6SLmiaavti_kdJ3UHiZw@mail.gmail.com> (raw)
In-Reply-To: <ae0bc57fad9bf7db15b9b3943dd5bb093a9d386d.camel@decadent.org.uk>

hello, I sent a email about 'can't wake problem' 4 days ago.

Is this problem related with mine?

> epoll and vb2_poll: can't wake_up

> Sun, Dec 30, 2018, 6:17 PM (4 days ago)
> to linux-kernel
> Hello, I encountered a "can't wake_up" problem when use camera on imx6.
>
> if delay some time after 'streamon' the /dev/video0, then add fd
> through epoll_ctl, then the process can't be waken_up after some time.
>
> I checked both the epoll / vb2_poll(videobuf2_core.c) code.
>
> epoll will pass 'poll_table' structure to vb2_poll, but it only
> contain valid function pointer when inserting fd.
>
> in vb2_poll, if found new data in done list, it will not call 'poll_wait'.
> after that, every call to vb2_poll will not contain valid poll_table,
> which will result in all calling to poll_wait will not work.
>
> so if app can process frames quickly, and found frame data when
> inserting fd (i.e. poll_wait will not be called or not contain valid
> function pointer), it will not found valid frame in 'vb2_poll' finally
> at some time, then call 'poll_wait' to expect be waken up at following
> vb2_buffer_done, but no good luck.
>
> I also checked the 'videobuf-core.c', there is no this problem.
>
> of course, both epoll and vb2_poll are right by itself side, but the
> result is we can't get new frames.
>
> I think by epoll's implementation, the user should always call poll_wait.
>
> and it's better to split the two actions: 'wait' and 'poll' both for
> epoll framework and all epoll users, for example, v4l2.
>
> am I right?

On Thu, Jan 3, 2019 at 4:17 AM Ben Hutchings <ben@decadent.org.uk> wrote:
>
> On Thu, 2018-11-08 at 14:03 +0200, Sakari Ailus wrote:
> > [ upstream commit 92539d3eda2c090b382699bbb896d4b54e9bdece ]
> >
> > Patch ad608fbcf166 changed how events were subscribed to address an issue
> > elsewhere. As a side effect of that change, the "add" callback was called
> > before the event subscription was added to the list of subscribed events,
> > causing the first event queued by the add callback (and possibly other
> > events arriving soon afterwards) to be lost.
> >
> > Fix this by adding the subscription to the list before calling the "add"
> > callback, and clean up afterwards if that fails.
> [...]
>
> I've queued this up for the next update, thanks.
>
> Ben.
>
> --
> Ben Hutchings
> Absolutum obsoletum. (If it works, it's out of date.) - Stafford Beer
>
>

  reply	other threads:[~2019-01-03  0:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08 12:03 [PATCH v3.16 0/2] V4L2 event subscription fixes Sakari Ailus
2018-11-08 12:03 ` [PATCH v3.16 1/2] v4l: event: Prevent freeing event subscriptions while accessed Sakari Ailus
2018-11-26  7:33   ` Greg KH
2018-11-08 12:03 ` [PATCH v3.16 2/2] v4l: event: Add subscription to list before calling "add" operation Sakari Ailus
2018-11-26  7:34   ` Greg KH
2019-01-02 19:01   ` Ben Hutchings
2019-01-03  0:58     ` Yi Qingliang [this message]
2019-01-03 10:15       ` Hans Verkuil
2019-01-03 12:00         ` Yi Qingliang
2018-11-09 23:12 ` [PATCH v3.16 0/2] V4L2 event subscription fixes Ben Hutchings

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=CADwFkYeFDgKvC5r6X4x-A73R1KwmPr6SLmiaavti_kdJ3UHiZw@mail.gmail.com \
    --to=niqingliang2003@gmail.com \
    --cc=ben@decadent.org.uk \
    --cc=dave.stevenson@raspberrypi.org \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).