Re: [PATCH] video4linux: Push down the BKL

From: Mauro Carvalho Chehab
Date: Mon May 26 2008 - 12:39:51 EST


On Fri, 23 May 2008 08:16:05 +0200
Hans Verkuil <hverkuil@xxxxxxxxx> wrote:

> On Friday 23 May 2008 04:08:04 Andy Walls wrote:
> > On Thu, 2008-05-22 at 22:37 +0100, Alan Cox wrote:
> > > For most drivers the generic ioctl handler does the work and we
> > > update it and it becomes the unlocked_ioctl method. Older drivers
> > > use the usercopy method so we make it do the work. Finally there
> > > are a few special cases.
> > >
> > > Signed-off-by: Alan Cox <alan@xxxxxxxxxx>
> >
> > I'd like to start planning out the changes to eliminate the BKL from
> > cx18.
> >
> > Could someone give me a brief education as to what elements of
> > cx18/ivtv_v4l2_do_ioctl() would be forcing the use of the BKL for
> > these drivers' ioctls? I'm assuming it's not the
> > mutex_un/lock(&....->serialize_lock) and that the answer's not in the
> > diff.
>
> To the best of my knowledge there is no need for a BKL in ivtv or cx18.
> It was just laziness on my part that I hadn't switched to
> unlocked_ioctl yet.

I suspect that this is true with almost all drivers. Yet, we may need to enable
BKL or add other locks on a few places. For example, the old tuner i2c probing
method relies on a global and unique static var to identify radio and tv
tuners. I can foresee a race condition there, if you have two boards probing
tuners at the same time.

Of course, we need to do several tests, since probably there are some issues
that we cannot foresee.

Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/