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 15:42:35 -0300	[thread overview]
Message-ID: <4BB4E91B.9030508@redhat.com> (raw)
In-Reply-To: <g2q829197381004011129lc706e6c3jcac6dcc756012173@mail.gmail.com>

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.

In the case of the initialization, the lock is needed, even if we fing a
way to load the module synchronously.

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

If the i2c lock was toggled to digital mode, then it means that the i2c
code is being in use simultaneously by analog and digital mode. It also
means that an i2c IR device, or alsa will have troubles also. So, we
really need one i2c lock that will protect the access to the I2C bus as
a hole, including the i2c gate.

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

Yes, this is also needed: we shouldn't let simultaneous stream access to the
analog and digital mode at the same time, but I don't see, by itself, any problem
on having both analog and digital nodes opened at the same time. So, the solution
seems to lock some resources between digital/analog access.
 
> 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.
> 
> Devin
> 


-- 

Cheers,
Mauro

  reply	other threads:[~2010-04-01 18:42 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 [this message]
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=4BB4E91B.9030508@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