linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Mike Isely <isely@pobox.com>
Cc: isely@isely.net, Michael Krufky <mkrufky@linuxtv.org>,
	Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Subject: Re: [patch] video: build fix for drivers/media/video/pvrusb2/
Date: Wed, 14 May 2008 03:01:20 -0300	[thread overview]
Message-ID: <20080514030120.7521b9a9@gaivota> (raw)
In-Reply-To: <Pine.LNX.4.64.0805131101070.20885@cnc.isely.net>

On Tue, 13 May 2008 11:02:05 -0500 (CDT)
Mike Isely <isely@isely.net> wrote:

> On Tue, 13 May 2008, Mike Isely wrote:
> 
> > On Tue, 13 May 2008, Mauro Carvalho Chehab wrote:
> > 
> > > On Tue, 13 May 2008 00:03:02 -0400
> > > "Michael Krufky" <mkrufky@linuxtv.org> wrote:
> > > 
> > > > 
> > > > That sounds like it would be OK, although something like this would
> > > > probably be better:
> > > > 
> > > >  config VIDEO_PVRUSB2
> > > >        tristate "Hauppauge WinTV-PVR USB2 support"
> > > > -       depends on VIDEO_V4L2 && I2C
> > > > +       depends on VIDEO_V4L2 && I2C && (DVB_CORE if VIDEO_PVRUSB2_DVB)
> > > >        select FW_LOADER
> > > >        select MEDIA_TUNER
> > > >        select VIDEO_TVEEPROM
> > > 
> > > This doesn't look to be a good idea, since VIDEO_PVRUSB2_DVB depends on
> > > VIDEO_PVRUSB2. So, you'll create a circular dependency. The syntax I've
> > > proposed seems cleaner. Of course, it needs to be tested. IMO, all hybrid
> > > devices should be dependent of VIDEO_MEDIA. This will help to avoid this kind
> > > of issue.
> > > 
> > > > I don't know if that syntax works for "depends on" , but it does work
> > > > for select.
> > > > 
> > > > if "depends on FOO if BAR" doesnt work, would adding "select DVB_CORE
> > > > if VIDEO_PVRUSB2_DVB" solve the problem?
> > > 
> > > Also, this leads into a circular reference.
> > 
> > Mauro:
> > 
> > Where is the loop that results in a circular reference?  No part of V4L 
> > or DVB depends (or otherwise has any reliance) on VIDEO_PVRUSB2.  All 
> > Mike Krufky is trying to set up is that VIDEO_PVRUSB2 should only depend 
> > on DVB_CORE if the DVB part of the driver (i.e. VIDEO_PVRUSB2_DVB) has 
> > been enabled.  Without VIDEO_PVRUSB2_DVB selected, then DVB_CORE is not 
> > required by the driver.
> > 
> > I've been quiet about this issue because I'm not a kconfig expert, but 
> > you've lost me with this conclusion.
> > 
> >   -Mike
> 
> Never mind.  I think I see it, and will figure out the rest off-line.

The solution were not as easy as I've originally imagined. VIDEO_MEDIA logic
were broken. So, all tuners were still broken.

I needed to fix VIDEO_MEDIA logic first, to obey to this truth table:

CONFIG_VIDEO_DEV        CONFIG_DVB_CORE         CONFIG_VIDEO_MEDIA
        N                       N                       N
        N                       M                       M
        N                       Y                       Y
        M                       N                       M
        M                       M                       M
        M                       Y                       M
        Y                       N                       Y
        Y                       M                       M
        Y                       Y                       Y

After this change, a simple dependency add solved the reported issue:

 config VIDEO_PVRUSB2
	tristate "Hauppauge WinTV-PVR USB2 support"
	depends on VIDEO_V4L2 && I2C
+	depends on VIDEO_MEDIA  # Avoids pvrusb = Y / DVB = M

I've tested the logic. seems fine now.

I did a quick review at the other modules that has hybrid support (cx88,
saa7134, em28xx, bttv) and they seemed ok to my eyes. Yet, I didn't test.

---

There are other configurations that seem to be broken. For example, if
V4L_CORE=m and DVB_CORE=y, a V4L driver should be 'M'. So, a tuner should also
be 'M', otherwise, it will break compilation. a DVB support for that card will
also be 'M', at the drivers I've reviewed.

However, a DVB-only driver can be 'Y', but can select a tuner. This will cause
a breakage.

I'll try to simulate some of those issues and see what happens.

Anyway, I've added severak Kbuild fixes at my -git tree:

http://www.kernel.org/git/?p=linux/kernel/git/mchehab/v4l-dvb.git

I intend to send the fixes I have later today. Now, I need to sleep ;)

Cheers,
Mauro

      reply	other threads:[~2008-05-14  6:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-11  7:21 [patch] video: build fix for drivers/media/video/pvrusb2/ Ingo Molnar
2008-05-11 12:34 ` Michael Krufky
2008-05-13  2:54   ` Mauro Carvalho Chehab
2008-05-13  4:03     ` Michael Krufky
2008-05-13 15:46       ` Mauro Carvalho Chehab
2008-05-13 15:54         ` mkrufky
2008-05-13 16:30           ` mkrufky
2008-05-13 15:56         ` Mike Isely
2008-05-13 16:02           ` Mike Isely
2008-05-14  6:01             ` Mauro Carvalho Chehab [this message]

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=20080514030120.7521b9a9@gaivota \
    --to=mchehab@infradead.org \
    --cc=g.liakhovetski@pengutronix.de \
    --cc=isely@isely.net \
    --cc=isely@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mkrufky@linuxtv.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;
as well as URLs for NNTP newsgroup(s).