linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] media: v4l2-mem2mem: fix poll() bug
@ 2020-08-25 14:55 Alexandre Courbot
  2020-08-25 14:55 ` [PATCH 1/2] media: v4l2-mem2mem: consider OUTPUT queue first when polling Alexandre Courbot
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Alexandre Courbot @ 2020-08-25 14:55 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Hans Verkuil, Nicolas Dufresne
  Cc: linux-media, linux-kernel, Alexandre Courbot

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-08-26 15:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 14:55 [PATCH 0/2] media: v4l2-mem2mem: fix poll() bug Alexandre Courbot
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

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).