mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alexandre Courbot <gnurou@gmail.com>
Subject: [PATCH 0/2] media: v4l2-mem2mem: fix poll() bug
Date: Tue, 25 Aug 2020 23:55:54 +0900	[thread overview]
Message-ID: <20200825145556.637323-1-gnurou@gmail.com> (raw)

This addresses a very corner case that probably nobody ever encounters,
but I have hit it when playing with vicoded so here is a tentative fix.

Patch 1/2 addresses the issue that when the last buffer of a m2m device
has been dequeued, any attempt to poll with EPOLLOUT will result in only
EPOLLIN being returned, even if OUTPUT buffers are still pending. The
issue stems from the fact that the last buffer check if done first, and
returns immediately if true.

Patch 2/2 builds on the first one to (hopefully) clean up the code a bit
and make the function flow easier to follow. Functionally speaking it is
supposed to be a no-op and it can safely be dropped if the former code
is preferred - the actual fix is in 1/2.

Alexandre Courbot (2):
  media: v4l2-mem2mem: consider OUTPUT queue first when polling
  media: v4l2-mem2mem: simplify poll logic a bit

 drivers/media/v4l2-core/v4l2-mem2mem.c | 42 +++++++++++---------------
 1 file changed, 18 insertions(+), 24 deletions(-)

-- 
2.28.0


             reply	other threads:[~2020-08-25 14:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 14:55 Alexandre Courbot [this message]
2020-08-25 14:55 ` [PATCH 1/2] media: v4l2-mem2mem: consider OUTPUT queue first when polling Alexandre Courbot
2020-08-26  4:07   ` Ezequiel Garcia
2020-08-26 11:21     ` Alexandre Courbot
2020-08-25 14:55 ` [PATCH 2/2] media: v4l2-mem2mem: simplify poll logic a bit Alexandre Courbot
2020-08-26  4:15   ` Ezequiel Garcia
2020-08-26 11:19     ` Alexandre Courbot
2020-08-26 14:32       ` Ezequiel Garcia
2020-08-26 15:23         ` Hans Verkuil
2020-08-26 12:46   ` Hans Verkuil
2020-08-25 22:10 ` [PATCH 0/2] media: v4l2-mem2mem: fix poll() bug Ezequiel Garcia
2020-08-26 11:25   ` Alexandre Courbot

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=20200825145556.637323-1-gnurou@gmail.com \
    --to=gnurou@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas.dufresne@collabora.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

all inboxes | Powered by JetHome®