Re: [patch] dvb: build failure fix

Previous thread: [2.6 patch] cleanup #include <linux/version.h>'s by Adrian Bunk on Monday, April 28, 2008 - 8:40 am. (1 message)

Next thread: [patch] doc: fix an incorrect suggestion to pass NULL for PCI like buses by Matti Linnanvuori on Monday, April 28, 2008 - 9:33 am. (3 messages)
From: Ingo Molnar
Date: Monday, April 28, 2008 - 9:24 am

fix build failure found via x86.git randconfig testing:

 drivers/built-in.o: In function `tda829x_attach':
 : undefined reference to `tda827x_attach'
 drivers/built-in.o: In function `tda829x_attach':
 : undefined reference to `tda18271_attach'

build failure is due to this nasty dependency:

  CONFIG_DVB_CORE=m but CONFIG_TUNER_TDA8290=y.

the solution is to follow the DVB_CORE constraint in the Kconfig. It's 
not pretty but works.

Kconfig should be enhanced instead with a new keyword: &quot;depends on 
instructure ...&quot; that makes it clear that the dependent module can only 
be of equal or lesser link mode - but not =y while the infrastructure 
module is =m. But i digress.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
---
 drivers/media/Kconfig |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Index: linux/drivers/media/Kconfig
===================================================================
--- linux.orig/drivers/media/Kconfig
+++ linux/drivers/media/Kconfig
@@ -106,21 +106,21 @@ if VIDEO_TUNER_CUSTOMIZE
 
 config TUNER_XC2028
 	tristate &quot;XCeive xc2028/xc3028 tuners&quot;
-	depends on I2C &amp;&amp; FW_LOADER
+	depends on I2C &amp;&amp; FW_LOADER &amp;&amp; ((DVB_CORE = m &amp;&amp; m) || (DVB_CORE = y))
 	default m if VIDEO_TUNER_CUSTOMIZE
 	help
 	  Say Y here to include support for the xc2028/xc3028 tuners.
 
 config TUNER_MT20XX
 	tristate &quot;Microtune 2032 / 2050 tuners&quot;
-	depends on I2C
+	depends on I2C &amp;&amp; ((DVB_CORE = m &amp;&amp; m) || (DVB_CORE = y))
 	default m if VIDEO_TUNER_CUSTOMIZE
 	help
 	  Say Y here to include support for the MT2032 / MT2050 tuner.
 
 config TUNER_TDA8290
 	tristate &quot;TDA 8290/8295 + 8275(a)/18271 tuner combo&quot;
-	depends on I2C
+	depends on I2C &amp;&amp; ((DVB_CORE = m &amp;&amp; m) || (DVB_CORE = y))
 	select DVB_TDA827X
 	select DVB_TDA18271
 	default m if VIDEO_TUNER_CUSTOMIZE
@@ -129,21 +129,21 @@ config TUNER_TDA8290
 
 config TUNER_TEA5761
 	tristate &quot;TEA 5761 radio tuner (EXPERIMENTAL)&quot;
-	depends on I2C &amp;&amp; EXPERIMENTAL
+	depends on I2C &amp;&amp; ...
From: Adrian Bunk
Date: Monday, April 28, 2008 - 11:04 am

It might work around the problem in your specific configuration, but 
it's not the correct solution.



What are you smoking?



Your funny additions are equivalent to &quot;&amp;&amp; DVB_CORE&quot;.


cu
Adrian

-- 

       &quot;Is there not promise of rain?&quot; Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       &quot;Only a promise,&quot; Lao Er said.
                                       Pearl S. Buck - Dragon Seed

--

From: Ingo Molnar
Date: Monday, April 28, 2008 - 12:53 pm

i dont have it anymore, but the key was what i wrote in the changelog 
above:

  CONFIG_DVB_CORE=m
  CONFIG_TUNER_TDA8290=y

if you look at the symbols above, their definition sites, and the 
dependencies between them you'll see why that breaks the build. (There 

right you are, thanks - the above change was the best hack 4 hours of 
sleep can buy ;-) Simplified patch below.

	Ingo

----------------------&gt;
Subject: dvb: build failure fix
From: Ingo Molnar &lt;mingo@elte.hu&gt;
Date: Mon Apr 28 18:17:58 CEST 2008

fix build failure:

 drivers/built-in.o: In function `tda829x_attach':
 : undefined reference to `tda827x_attach'
 drivers/built-in.o: In function `tda829x_attach':
 : undefined reference to `tda18271_attach'

due to:

  CONFIG_DVB_CORE=m but CONFIG_TUNER_TDA8290=y.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
---
 drivers/media/Kconfig |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Index: linux/drivers/media/Kconfig
===================================================================
--- linux.orig/drivers/media/Kconfig
+++ linux/drivers/media/Kconfig
@@ -106,21 +106,21 @@ if VIDEO_TUNER_CUSTOMIZE
 
 config TUNER_XC2028
 	tristate &quot;XCeive xc2028/xc3028 tuners&quot;
-	depends on I2C &amp;&amp; FW_LOADER
+	depends on I2C &amp;&amp; FW_LOADER &amp;&amp; ((DVB_CORE = m &amp;&amp; m) || (DVB_CORE = y))
 	default m if VIDEO_TUNER_CUSTOMIZE
 	help
 	  Say Y here to include support for the xc2028/xc3028 tuners.
 
 config TUNER_MT20XX
 	tristate &quot;Microtune 2032 / 2050 tuners&quot;
-	depends on I2C
+	depends on I2C &amp;&amp; ((DVB_CORE = m &amp;&amp; m) || (DVB_CORE = y))
 	default m if VIDEO_TUNER_CUSTOMIZE
 	help
 	  Say Y here to include support for the MT2032 / MT2050 tuner.
 
 config TUNER_TDA8290
 	tristate &quot;TDA 8290/8295 + 8275(a)/18271 tuner combo&quot;
-	depends on I2C
+	depends on I2C &amp;&amp; ((DVB_CORE = m &amp;&amp; m) || (DVB_CORE = y))
 	select DVB_TDA827X
 	select DVB_TDA18271
 	default m if VIDEO_TUNER_CUSTOMIZE
@@ -129,21 +129,21 @@ config TUNER_TDA8290
 
 config TUNER_TEA5761
 ...
From: Adrian Bunk
Date: Monday, April 28, 2008 - 2:01 pm

That's bad since it makes it harder for other people to reproduce the 

TUNER_TDA8290 is the only affected driver, your patch also adds wrong 
dependences to other driver.

And the underlying problem is that it has both an analog an a DVB tuner, 
and although forcing a dependency on DVB_CORE might make the randconfig 
crowd happy it's not the correct solution.

Mauro, where were we regarding this issue?

What about:

config TUNER_TDA8290
        tristate &quot;TDA 8290/8295 + 8275(a)/18271 tuner combo&quot;
        depends on I2C
	depends on DVB_CORE || DVB_CORE=n
        select DVB_TDA827X if DVB_CORE
        select DVB_TDA18271 if DVB_CORE
        default m if VIDEO_TUNER_CUSTOMIZE
        help
          Say Y here to include support for Philips TDA8290+8275(a) tuner.


Still the old one...


cu
Adrian

-- 

       &quot;Is there not promise of rain?&quot; Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       &quot;Only a promise,&quot; Lao Er said.
                                       Pearl S. Buck - Dragon Seed

--

From: Mauro Carvalho Chehab
Date: Monday, April 28, 2008 - 2:25 pm

On Tue, 29 Apr 2008 00:01:22 +0300


This will fix compilation, but some drivers will be broken, since tda8275 is
needed even for some analog-only drivers.

It would be better to do a &quot;select DVB_CORE&quot;, although this is also ugly.

I'm pinging Mkrufky. He is the one that touched a lot on those drivers. Maybe
he can come up with a better solution.

Cheers,
Mauro
--

From: mkrufky
Date: Monday, April 28, 2008 - 2:29 pm

The fix for this issue will come &quot;for free&quot; after the tuner location 
reorganization to the media/common/ folder.

If you try the devel branch of mauro's v4l-dvb tree, is the issue 
resolved for you?

Regards,

Mike
--

From: Ingo Molnar
Date: Tuesday, April 29, 2008 - 5:14 am

btw., will that go into v2.6.26? If not automatically then please push 
it into ahead separately if possible.

	Ingo
--

From: Mauro Carvalho Chehab
Date: Wednesday, April 30, 2008 - 12:17 pm

On Mon, 28 Apr 2008 17:29:49 -0400

Yes, but I think we should try do do something for 2.6.25 and 2.6.24. Maybe, we
may just do:
obj-y += /dvb

At media/Kconfig.


Cheers,
Mauro
--

From: Adrian Bunk
Date: Wednesday, April 30, 2008 - 12:28 pm

Toralf and Ingo only discovered it during randconfig testing.


Do DVB_TDA827X/DVB_TDA18271 need anything from DVB_CORE?


cu
Adrian

-- 

       &quot;Is there not promise of rain?&quot; Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       &quot;Only a promise,&quot; Lao Er said.
                                       Pearl S. Buck - Dragon Seed

--

From: mkrufky
Date: Wednesday, April 30, 2008 - 12:31 pm

DVB_TDA827X and DVB_TDA18271 do not need anything from DVB_CORE -- their 
only dependency is I2C_CORE.

I think Mauro renamed those Kconfig symbols to MEDIA_TUNER_TDAfoo now, btw.

-Mike
--

From: Mauro Carvalho Chehab
Date: Wednesday, April 30, 2008 - 12:52 pm

On Wed, 30 Apr 2008 15:31:42 -0400

No.

Yet, the configuration may be valid. If you have a board with tda8290, it
_will_ need another chip, like tda827x.

In the past, both tda8290 and tda827x were handled by the same driver, and
worked for analog only.


I can't foresee any issues with those drivers. The risk I can see is to compile
some dvb core things that aren't needed, or whose Kconfig dependencies may be
incomplete.

I didn't make yet a deeper analysis to be sure that this won't cause any issues,
but I suspect that this would be safe.

I agree that we need to check the resulting dependencies.

Cheers,
Mauro
--

From: Adrian Bunk
Date: Wednesday, April 30, 2008 - 1:01 pm

drivers/media/ is the part of the kernel with the most fragile kconfig
constructs.

And we are talking about bringing a solution into -stable that has never 
and will never be in mainline.

A compile error in a configuration without practical relevance isn't a 

cu
Adrian

-- 

       &quot;Is there not promise of rain?&quot; Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       &quot;Only a promise,&quot; Lao Er said.
                                       Pearl S. Buck - Dragon Seed

--

From: mkrufky
Date: Wednesday, April 30, 2008 - 3:32 pm

I agree wholeheartedly -- we should not change the build procedure for 
the -stable series.

I hope nobody was seriously considering throwing in this sort of monkey 
wrench to a stable kernel.

-Mike

--

From: Mauro Carvalho Chehab
Date: Monday, April 28, 2008 - 12:47 pm

On Mon, 28 Apr 2008 18:24:21 +0200

Hmm... if the issues are with tda827x and tda18271, why have you touched on the above drivers?

Ok, this one may be broken.

I'm working on some changes that will hopefully fix this issue at the proper way.

Cheers,
Mauro
--

From: Ingo Molnar
Date: Monday, April 28, 2008 - 1:30 pm

ok, great. FYI, this has been reported months ago too so it's a 
long-time breakage - would be nice to fix it upstream even if it's the 
initial fix is a band-aid.

	Ingo
--

From: Mauro Carvalho Chehab
Date: Monday, April 28, 2008 - 2:03 pm

Agreed. Probably, this is broken since 2.6.24, where hybrid tuner support started.

Cheers,
Mauro
--

From: Ingo Molnar
Date: Monday, April 28, 2008 - 2:17 pm

yeah, i think i saw it last for the first time. It's probably not a too 
logical combination of config options that a real user would pick 
voluntarily, but it's worth fixing nevertheless as randconfig is such a 
useful tool.

	Ingo
--

From: Ingo Molnar
Date: Monday, April 28, 2008 - 2:20 pm

FYI, x86.git randconfig testing found another build bug as well:

  http://redhat.com/~mingo/misc/config-Mon_Apr_28_23_14_46_CEST_2008.bad

build log below. Note that this seems to be a more clear-cut case as 
module support was disabled.

	Ingo

---------------&gt;
drivers/built-in.o: In function `cx23885_initialize_codec':
cx23885-417.c:(.text+0x1dd5a7): undefined reference to `cx2341x_update'
drivers/built-in.o: In function `cx23885_queryctrl':
cx23885-417.c:(.text+0x1de02e): undefined reference to `cx2341x_ctrl_query'
drivers/built-in.o: In function `mpeg_do_ioctl':
cx23885-417.c:(.text+0x1dea0e): undefined reference to `cx2341x_log_status'
cx23885-417.c:(.text+0x1dea67): undefined reference to `cx2341x_ctrl_get_menu'
cx23885-417.c:(.text+0x1dec1a): undefined reference to `cx2341x_ext_ctrls'
cx23885-417.c:(.text+0x1deeaf): undefined reference to `cx2341x_ext_ctrls'
cx23885-417.c:(.text+0x1deedb): undefined reference to `cx2341x_update'
drivers/built-in.o:(.data+0x54c40): undefined reference to `cx2341x_mpeg_ctrls'
6.22user 1.55system 0:03.08elapsed 251%CPU (0avgtext+0avgdata 0maxresident)k
--

From: Ingo Molnar
Date: Monday, April 28, 2008 - 2:23 pm

ok, found one bug, find the fix for that below. One more bug to go:


	Ingo

--------------&gt;
Subject: dvb: fix3
From: Ingo Molnar &lt;mingo@elte.hu&gt;
Date: Mon Apr 28 23:22:13 CEST 2008

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
---
 drivers/media/video/cx23885/Kconfig |    1 +
 1 file changed, 1 insertion(+)

Index: linux/drivers/media/video/cx23885/Kconfig
===================================================================
--- linux.orig/drivers/media/video/cx23885/Kconfig
+++ linux/drivers/media/video/cx23885/Kconfig
@@ -9,6 +9,7 @@ config VIDEO_CX23885
 	select VIDEO_IR
 	select VIDEOBUF_DVB
 	select VIDEO_CX25840
+	select VIDEO_CX2341X
 	select DVB_TUNER_MT2131 if !DVB_FE_CUSTOMISE
 	select DVB_S5H1409 if !DVB_FE_CUSTOMISE
 	select DVB_LGDT330X if !DVB_FE_CUSTOMISE
--

From: Ingo Molnar
Date: Monday, April 28, 2008 - 2:25 pm

ok, the patch below fixes the bug fully here. (there might be other 
aspects to it though)

	Ingo

--------------&gt;
Subject: dvb: fix3
From: Ingo Molnar &lt;mingo@elte.hu&gt;
Date: Mon Apr 28 23:22:13 CEST 2008

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
---
 drivers/media/video/cx23885/Kconfig |    2 ++
 1 file changed, 2 insertions(+)

Index: linux/drivers/media/video/cx23885/Kconfig
===================================================================
--- linux.orig/drivers/media/video/cx23885/Kconfig
+++ linux/drivers/media/video/cx23885/Kconfig
@@ -9,6 +9,8 @@ config VIDEO_CX23885
 	select VIDEO_IR
 	select VIDEOBUF_DVB
 	select VIDEO_CX25840
+	select VIDEO_CX2341X
+	select DVB_DIB7000P
 	select DVB_TUNER_MT2131 if !DVB_FE_CUSTOMISE
 	select DVB_S5H1409 if !DVB_FE_CUSTOMISE
 	select DVB_LGDT330X if !DVB_FE_CUSTOMISE
--

Previous thread: [2.6 patch] cleanup #include <linux/version.h>'s by Adrian Bunk on Monday, April 28, 2008 - 8:40 am. (1 message)

Next thread: [patch] doc: fix an incorrect suggestion to pass NULL for PCI like buses by Matti Linnanvuori on Monday, April 28, 2008 - 9:33 am. (3 messages)