Re: [PATCH] video4linux: Push down the BKL

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andy Walls
Date: Tuesday, May 27, 2008 - 7:37 pm

On Tue, 2008-05-27 at 20:46 -0400, Devin Heitmueller wrote:

I don't think a lock would be good for MythTV or any other app that
open()s multiple nodes at once.  How can an app know that it's
dead-locking or barring itself via the kernel driver?

Maybe return an EBUSY or E-something else for these cases when Myth
tries to open() the second device node, when there's an underlying
factor that requires things to be mutually exclusive.  Allowing things
like read() to allow hardware mode switching between analog and digital
seems like it could result in really weird behaviors at the application.

I'll cite a precedent:
ivtv returns EBUSY on open() when there's a conflict with it's various
analog devices nodes that depend on the same underlying hardware: MPG,
YUV, FM Radio, etc.

I note the man page for open() doesn't list EBUSY as a valid errno.
However, the V4L2 API Spec does list EBUSY as a valid errno for V4L2
open().



I like to blame MythTV for a lot of things. ;)

But in this case I can't.  The driver probably shouldn't hold a lock and
suspend an open() indefinitely (IMO).  It should say the device is BUSY
as that is the truth: an underlying hardware device or resource is busy.


Regards,
Andy

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] video4linux: Push down the BKL, Alan Cox, (Thu May 22, 2:37 pm)
Re: [PATCH] video4linux: Push down the BKL, Andy Walls, (Thu May 22, 7:08 pm)
Re: [PATCH] video4linux: Push down the BKL, Hans Verkuil, (Thu May 22, 11:16 pm)
Re: [PATCH] video4linux: Push down the BKL, Hans Verkuil, (Thu May 22, 11:28 pm)
Re: [PATCH] video4linux: Push down the BKL, Alan Cox, (Fri May 23, 2:09 am)
Re: [PATCH] video4linux: Push down the BKL , Jonathan Corbet, (Fri May 23, 6:56 am)
Re: [PATCH] video4linux: Push down the BKL, Alan Cox, (Fri May 23, 8:39 am)
Re: [PATCH] video4linux: Push down the BKL , Jonathan Corbet, (Fri May 23, 9:09 am)
Re: [PATCH] video4linux: Push down the BKL, Alan Cox, (Fri May 23, 11:58 am)
Re: [PATCH] video4linux: Push down the BKL, Hans Verkuil, (Fri May 23, 12:05 pm)
Re: [PATCH] video4linux: Push down the BKL, Mike Isely, (Sun May 25, 4:46 pm)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Mon May 26, 9:34 am)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Mon May 26, 9:39 am)
Re: [PATCH] video4linux: Push down the BKL, Hans Verkuil, (Mon May 26, 9:46 am)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Mon May 26, 9:59 am)
Re: [PATCH] video4linux: Push down the BKL, Alan Cox, (Mon May 26, 1:23 pm)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Mon May 26, 2:10 pm)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Mon May 26, 2:14 pm)
Re: [PATCH] video4linux: Push down the BKL, Alan Cox, (Mon May 26, 3:01 pm)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Tue May 27, 6:10 am)
Re: [PATCH] video4linux: Push down the BKL, Jonathan Corbet, (Tue May 27, 8:41 am)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Tue May 27, 9:31 am)
Re: [PATCH] video4linux: Push down the BKL, Jonathan Corbet, (Tue May 27, 9:37 am)
Re: [PATCH] video4linux: Push down the BKL, Alan Cox, (Tue May 27, 11:14 am)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Tue May 27, 11:59 am)
Re: [PATCH] video4linux: Push down the BKL, Devin Heitmueller, (Tue May 27, 12:26 pm)
Re: [PATCH] video4linux: Push down the BKL, Arjan van de Ven, (Tue May 27, 12:50 pm)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Tue May 27, 1:24 pm)
Re: [PATCH] video4linux: Push down the BKL, Mauro Carvalho Chehab, (Tue May 27, 2:00 pm)
Re: [PATCH] video4linux: Push down the BKL, Devin Heitmueller, (Tue May 27, 2:22 pm)
Re: [PATCH] video4linux: Push down the BKL, Andy Walls, (Tue May 27, 4:48 pm)
Re: [PATCH] video4linux: Push down the BKL, Devin Heitmueller, (Tue May 27, 5:46 pm)
Re: [PATCH] video4linux: Push down the BKL, Andy Walls, (Tue May 27, 7:37 pm)
Re: [PATCH] video4linux: Push down the BKL, Devin Heitmueller, (Tue May 27, 7:47 pm)
Re: [PATCH] video4linux: Push down the BKL, Hans Verkuil, (Tue May 27, 11:13 pm)
Re: [PATCH] video4linux: Push down the BKL, Alan Cox, (Wed May 28, 1:34 am)