public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org
Subject: Re: V4L-DVB drivers and BKL
Date: Thu, 01 Apr 2010 14:36:43 -0300	[thread overview]
Message-ID: <4BB4D9AB.6070907@redhat.com> (raw)
In-Reply-To: <x2y829197381004010958u82deb516if189d4fb00fbc5e6@mail.gmail.com>

Devin Heitmueller wrote:
> On Thu, Apr 1, 2010 at 11:02 AM, Mauro Carvalho Chehab
> <mchehab@redhat.com> wrote:
>> I remember I had to do it on em28xx:
>>
>> This is the init code for it:
>>        ...
>>        mutex_init(&dev->lock);
>>        mutex_lock(&dev->lock);
>>        em28xx_init_dev(&dev, udev, interface, nr);
>>        ...
>>        request_modules(dev);
>>
>>        /* Should be the last thing to do, to avoid newer udev's to
>>           open the device before fully initializing it
>>         */
>>        mutex_unlock(&dev->lock);
>>        ...
>>
>> And this is the open code:
>>
>> static int em28xx_v4l2_open(struct file *filp)
>> {
>>        ...
>>        mutex_lock(&dev->lock);
>>        ...
>>        mutex_unlock(&dev->lock);
>>
> 
> It's probably worth noting that this change is actually pretty badly
> broken.  Because the modules are loading asynchronously, there is a
> high probability that the em28xx-dvb driver will still be loading when
> hald connects in to the v4l device.  That's the big reason people
> often see things like tvp5150 i2c errors when the driver is first
> loaded up.
> 
> It's a good idea in theory, but pretty fatally flawed due to the async
> loading (as to make it work properly you would have to do something
> like locking the mutex in em28xx and clearing it in em28xx-dvb at the
> end of its initialization).

If you take a look at em28xx-dvb, it is not lock-protected. If the bug is due
to the async load, we'll need to add the same locking at *alsa and *dvb
parts of em28xx.

Yet, in this specific case, as the errors are due to the reception of
wrong data from tvp5150, maybe the problem is due to the lack of a 
proper lock at the i2c access. 


> 
> Devin
> 


-- 

Cheers,
Mauro

  reply	other threads:[~2010-04-01 17:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01  8:01 V4L-DVB drivers and BKL Hans Verkuil
2010-04-01  9:23 ` Laurent Pinchart
2010-04-01 11:11   ` Hans Verkuil
2010-04-01 12:11     ` Laurent Pinchart
2010-04-01 14:12       ` Mauro Carvalho Chehab
2010-04-01 14:30         ` Laurent Pinchart
2010-04-01 14:44           ` Mauro Carvalho Chehab
2010-04-01 14:42         ` Hans Verkuil
2010-04-01 15:02           ` Mauro Carvalho Chehab
2010-04-01 15:27             ` Hans Verkuil
2010-04-01 16:58             ` Devin Heitmueller
2010-04-01 17:36               ` Mauro Carvalho Chehab [this message]
2010-04-01 18:29                 ` Devin Heitmueller
2010-04-01 18:42                   ` Mauro Carvalho Chehab
2010-04-01 18:56                     ` Devin Heitmueller
2010-04-01 21:07                       ` Mauro Carvalho Chehab
2010-04-01 21:40                         ` Devin Heitmueller
2010-04-01 23:10                           ` Mauro Carvalho Chehab
2010-04-01 21:11                       ` Hans Verkuil
2010-04-01 21:06                   ` Hans Verkuil
2010-04-01 21:16                     ` Mauro Carvalho Chehab
2010-04-01 21:29                       ` Devin Heitmueller
2010-04-03  0:23                         ` Andy Walls
2010-04-07 20:07               ` [PATCH] em28xx: fix locks during dvb init sequence - was: " Mauro Carvalho Chehab
2010-04-07 20:15                 ` Devin Heitmueller
2010-04-07 20:23                   ` Mauro Carvalho Chehab
2010-04-01 11:57 ` Stefan Richter
2010-04-01 12:11   ` Hans Verkuil
2010-04-01 12:08 ` Stefan Richter
2010-04-01 12:12   ` Stefan Richter
2010-04-01 14:03 ` Mauro Carvalho Chehab
2010-04-03 14:19   ` Stefan Richter

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=4BB4D9AB.6070907@redhat.com \
    --to=mchehab@redhat.com \
    --cc=dheitmueller@kernellabs.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@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