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

Hans Verkuil wrote:
> On Thursday 01 April 2010 20:29:52 Devin Heitmueller wrote:
>> On Thu, Apr 1, 2010 at 1:36 PM, Mauro Carvalho Chehab
>> <mchehab@redhat.com> wrote:
>>> 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.
>> Yes, that is correct.  The problem effects both dvb and alsa, although
>> empirically it is more visible with the dvb case.
>>
>>> 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.
>> The problem is because hald sees the new device and is making v4l2
>> calls against the tvp5150 even though the gpio has been toggled over
>> to digital mode.  Hence an i2c lock won't help.  We would need to
>> implement proper locking of analog versus digital mode, which
>> unfortunately would either result in hald getting back -EBUSY on open
>> of the V4L device or the DVB module loading being deferred while the
>> v4l side of the board is in use (neither of which is a very good
>> solution).
>>
>> This is what got me thinking a few weeks ago that perhaps the
>> submodules should not be loaded asynchronously.  In that case, at
>> least the main em28xx module could continue to hold the lock while the
>> submodules are still being loaded.
> 
> What was the reason behind the asynchronous loading? In general it simplifies
> things a lot if you load modules up front.

The reason is to avoid a dead lock: driver A depends on symbols on B (the
other driver init code) that depends on symbols at A (core stuff, locks, etc). 

There are other approaches to avoid this trouble, like the attach method used
by the DVB modules, but an asynchronous (and parallel) load offers another
advantage: it speeds up boot time, as other processors can take care of the
load of the additonal modules.

-- 

Cheers,
Mauro

  reply	other threads:[~2010-04-01 21:16 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
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 [this message]
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=4BB50D1A.7020803@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