Re: [v4l-dvb-maintainer] [GIT PATCHES] V4L/DVB updates and fixes for 2.6.26

Previous thread: [PATCH] libata.h: reorganize ata_device a bit by Jeff Garzik on Tuesday, April 29, 2008 - 2:50 pm. (1 message)

Next thread: [git patches] libata fixes by Jeff Garzik on Tuesday, April 29, 2008 - 3:09 pm. (1 message)
From: Mauro Carvalho Chehab
Date: Tuesday, April 29, 2008 - 2:50 pm

Linus,

Please pull from:
        ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git master

For the following:

   - Fixes on mtm001, mtv022, pvrusb2, ivtv, cx88 and saa7134;
   - new board additions on saa7134 and ivtv;
   - load tuners only when needed;
   - reorganization of tuner drivers that are shared between DVB and V4L;
   - Addition of a new driver for Conexant CX23418 MPEG encoder chip (cx18).

Notice: the diffstat is very big, due to the "mv" operations.

Cheers,
Mauro.

---

 Documentation/video4linux/CARDLIST.saa7134         |    3 +-
 Documentation/video4linux/cx18.txt                 |   34 +
 drivers/media/Kconfig                              |  172 +---
 drivers/media/Makefile                             |   10 +-
 drivers/media/common/tuners/Kconfig                |  146 +++
 drivers/media/common/tuners/Makefile               |   25 +
 .../{dvb/frontends => common/tuners}/mt2060.c      |    0 
 .../{dvb/frontends => common/tuners}/mt2060.h      |    4 +-
 .../{dvb/frontends => common/tuners}/mt2060_priv.h |    0 
 drivers/media/{video => common/tuners}/mt20xx.c    |    0 
 drivers/media/{video => common/tuners}/mt20xx.h    |    2 +-
 .../{dvb/frontends => common/tuners}/mt2131.c      |    0 
 .../{dvb/frontends => common/tuners}/mt2131.h      |    4 +-
 .../{dvb/frontends => common/tuners}/mt2131_priv.h |    0 
 .../{dvb/frontends => common/tuners}/mt2266.c      |    0 
 .../{dvb/frontends => common/tuners}/mt2266.h      |    4 +-
 .../{dvb/frontends => common/tuners}/qt1010.c      |    0 
 .../{dvb/frontends => common/tuners}/qt1010.h      |    4 +-
 .../{dvb/frontends => common/tuners}/qt1010_priv.h |    0 
 .../frontends => common/tuners}/tda18271-common.c  |    0 
 .../{dvb/frontends => common/tuners}/tda18271-fe.c |    0 
 .../tuners/tda18271-maps.c}                        |    0 
 .../frontends => common/tuners}/tda18271-priv.h    |    0 
 .../{dvb/frontends => common/tuners}/tda18271.h    |    2 +-
 .../{dvb/frontends => ...
From: Linus Torvalds
Date: Tuesday, April 29, 2008 - 2:59 pm

No, the diffstat is big due to the new cx18 driver. The mv's are almost 
all just pure moves. But that new driver alone is

	47 files changed, 10217 insertions(+), 0 deletions(-)

in a single commit.

Whee...

		Linus
--

From: Michael Krufky
Date: Tuesday, April 29, 2008 - 4:49 pm

On Tue, Apr 29, 2008 at 5:50 PM, Mauro Carvalho Chehab



Linus has already merged the changes (thank you, Linus) ... However,
there is a bug.

My "remove static dependencies on analog tuner sub-modules" patch was
applied after Mauro's "Rename common tuner Kconfig names to use the
same" patch.

My patch has conditional behavior, based on CONFIG_DVB_CORE_ATTACH,
which was renamed to CONFIG_MEDIA_ATTACH in Mauro's patch.

To fix this, we need to do:

sed -i s/"CONFIG_DVB_CORE_ATTACH"/"CONFIG_MEDIA_ATTACH"/1
drivers/media/video/tuner-core.c

The issue will cause invalid module use counts upon unloading analog
tuner modules, if CONFIG_MEDIA_ATTACH is enabled.

I would be happy to fix this myself, but Mauro's patch has not yet
been backported into the linuxtv.org repository.

Mauro, can you do the above fix and send it in to Linus?

Thanks,

Mike Krufky
--

From: Mauro Carvalho Chehab
Date: Tuesday, April 29, 2008 - 5:00 pm

On Tue, 29 Apr 2008 19:49:24 -0400

Sure. Merge conflicts... bah...

I'll also double check if there aren't also other conflicts. It is just a
matter or run the sed script again ;)


Cheers,
Mauro
--

From: Ingo Molnar
Date: Wednesday, April 30, 2008 - 12:48 am

fix allmodconfig build bug introduced in latest -git by commit 
7c91f0624a9 ("V4L/DVB(7767): Move tuners to common/tuners"):

  LD      kernel/built-in.o
  LD      drivers/built-in.o
  ld: drivers/media/built-in.o: No such file: No such file or directory

which happens if all media drivers are modular:

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

In that case there's no obj-y rule connecting all the built-in.o files and
the link tree breaks.

the fix is to add a guaranteed obj-y rule for the core vmlinux to build.
(which results in an empty object file if all media drivers are modular)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 drivers/media/Makefile |    2 ++
 1 file changed, 2 insertions(+)

Index: linux/drivers/media/Makefile
===================================================================
--- linux.orig/drivers/media/Makefile
+++ linux/drivers/media/Makefile
@@ -2,6 +2,8 @@
 # Makefile for the kernel multimedia device drivers.
 #
 
+obj-y := common/
+
 obj-$(CONFIG_VIDEO_MEDIA) += common/
 
 # Since hybrid devices are here, should be compiled if DVB and/or V4L
--

From: David Miller
Date: Wednesday, April 30, 2008 - 12:52 am

From: Ingo Molnar <mingo@elte.hu>

I was seeing this too, as I think was Stephen Rothwell.
--

From: Ingo Molnar
Date: Wednesday, April 30, 2008 - 1:13 am

i think any build which has the media drivers only as modules will 
trigger it, so it's rather widespread. My fix has held up fine for 10 
randconfigs so far so it should do the trick.

i'm wondering though why similar problems are not more common. A quick 
look at drivers/Makefile suggests that there are many obj-y rules there 
for driver sub-trees that can be all-modular, not just video:

 obj-y                           += video/
 obj-y                           += char/
 obj-y                           += serial/
 obj-y                           += base/ block/ misc/ mfd/ net/ media/
 obj-y                           += macintosh/
 obj-y                           += ieee1394/
 obj-y                           += cdrom/
 obj-y                           += auxdisplay/
 obj-y                           += i2c/
 obj-y                           += lguest/
 obj-y                           += firmware/

drivers/net/ obj-y is kept alive by the "obj-y wireless/" rule i think, 
but what makes other sub-trees link, like drivers/macintosh/ ?

so kbuild apparently has smarts to handle this case - but somehow it 
still failed for drivers/media/.

Sam Cc:-ed - am i missing some detail in this analysis?

hm, one weird rule is drivers/video/matrox/Makefile's my-obj- rule.

	Ingo
--

From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 1:27 am

You also have to make clean after today's pull or...

Kernel: arch/x86/boot/bzImage is ready  (#3)
ERROR: "tea5761_attach" [drivers/media/video/tuner.ko] undefined!
ERROR: "tea5761_autodetection" [drivers/media/video/tuner.ko] undefined!
ERROR: "microtune_attach" [drivers/media/video/tuner.ko] undefined!
ERROR: "simple_tuner_attach" [drivers/media/video/tuner.ko] undefined!
ERROR: "tda9887_attach" [drivers/media/video/tuner.ko] undefined!
ERROR: "tea5767_autodetection" [drivers/media/video/tuner.ko] undefined!
ERROR: "xc5000_attach" [drivers/media/video/tuner.ko] undefined!
ERROR: "xc2028_attach" [drivers/media/video/tuner.ko] undefined!
ERROR: "tda829x_probe" [drivers/media/video/tuner.ko] undefined!
ERROR: "tda829x_attach" [drivers/media/video/tuner.ko] undefined!
ERROR: "tea5767_attach" [drivers/media/video/tuner.ko] undefined!
ERROR: "xc2028_attach" [drivers/media/video/saa7134/saa7134-dvb.ko] undefined!
ERROR: "simple_tuner_attach" [drivers/media/video/saa7134/saa7134-dvb.ko] undefined!
ERROR: "tda827x_attach" [drivers/media/video/saa7134/saa7134-dvb.ko] undefined!



--

From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 1:42 am

Hm, so I thought.  Error is constant.  Going back to .yesterday.


From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 1:56 am

Turning CONFIG_MEDIA_ATTACH on fixed it.  I must have switched it somehow before.


--

From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 2:20 am

With modular build patch and CONFIG_MEDIA_ATTACH, she builds, but BUG()s

[   15.437741] Linux video capture interface: v2.00
[   15.807047] saa7130/34: v4l2 driver version 0.2.14 loaded
[   15.817083] ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 16
[   15.828480] saa7133[0]: found at 0000:02:00.0, rev: 209, irq: 16, latency: 84, mmio: 0xfddff000
[   15.841223] saa7133[0]: subsystem: 16be:000d, board: Medion Md8800 Quadro [card=96,autodetected]
[   15.854174] saa7133[0]: board init: gpio is 0
[   15.897026] ACPI: PCI Interrupt 0000:00:1b.0[A] -> GSI 22 (level, low) -> IRQ 22
[   15.908649] PCI: Setting latency timer of device 0000:00:1b.0 to 64
[   15.954989] hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...
[   16.026049] saa7133[0]: i2c eeprom 00: be 16 0d 00 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
[   16.038843] saa7133[0]: i2c eeprom 10: 00 ff 86 0f ff 20 ff 00 01 50 32 79 01 3c ca 50
[   16.051778] saa7133[0]: i2c eeprom 20: 01 40 01 02 02 03 01 00 06 ff 00 29 02 51 96 2b
[   16.065076] saa7133[0]: i2c eeprom 30: a7 58 7a 1f 03 8e 84 5e da 7a 04 b3 05 87 b2 3c
[   16.078816] saa7133[0]: i2c eeprom 40: ff 28 00 c0 96 10 03 00 c0 1c fd 79 44 9f c2 8f
[   16.092851] saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.107096] saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.121254] saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.135583] saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.149827] saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.163636] saa7133[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.177386] saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.190724] saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   16.203395] saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ...
From: Andrew Morton
Date: Wednesday, April 30, 2008 - 4:40 am

Does this make it feel better?

--- a/drivers/media/video/tuner-core.c~a
+++ a/drivers/media/video/tuner-core.c
@@ -40,11 +40,11 @@
 	typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
 	if (__a) { \
 		__r = (int) __a(ARGS); \
+		symbol_put(FUNCTION); \
 	} else { \
 		printk(KERN_ERR "TUNER: Unable to find " \
 				"symbol "#FUNCTION"()\n"); \
 	} \
-	symbol_put(FUNCTION); \
 	__r; \
 })
 
_

--

From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 6:03 am

Well, it doesn't go BUG() any more, but it now goes oops.

[   13.443404] saa7133[0]: i2c eeprom 00: be 16 0d 00 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
[   13.456281] saa7133[0]: i2c eeprom 10: 00 ff 86 0f ff 20 ff 00 01 50 32 79 01 3c ca 50
[   13.469575] saa7133[0]: i2c eeprom 20: 01 40 01 02 02 03 01 00 06 ff 00 29 02 51 96 2b
[   13.483794] saa7133[0]: i2c eeprom 30: a7 58 7a 1f 03 8e 84 5e da 7a 04 b3 05 87 b2 3c
[   13.498518] saa7133[0]: i2c eeprom 40: ff 28 00 c0 96 10 03 00 c0 1c fd 79 44 9f c2 8f
[   13.507664] saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507670] saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507676] saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507680] saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507684] saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507688] saa7133[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507692] saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507696] saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507700] saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507703] saa7133[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.507707] saa7133[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.666587] TUNER: Unable to find symbol tda829x_probe()
[   13.674638] tuner' 1-004b: chip found @ 0x96 (saa7133[0])
[   13.691175] DVB: Unable to find symbol tda9887_attach()
[   13.698968] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[   13.709509] IP: [<ffffffff80302934>] strlcpy+0x11/0x36
[   13.711135] PGD be167067 PUD be140067 PMD 0 
[   13.711137] Oops: 0000 [1] SMP 
[   13.711139] CPU 2 
[   13.711140] Modules linked in: tuner(+) snd_hda_intel(+) saa7134(+) ...
From: Michael Krufky
Date: Wednesday, April 30, 2008 - 7:39 am

Hello-

Andrew's patch should have fixed the issue.  His patch was correct, btw...

Acked-by: Michael Krufky <mkrufky@linuxtv.org>

If you do make clean, does this issue persist?

Is your .config posted somewhere in this thread?  (I dont see it)
Please post the LKML link if the .config is already posted.

Regards,

Mike
--

From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 8:30 am

Yes, I just double checked.  I even scrubbed /lib/modules for extra
cleanliness and...

[   13.564532] saa7130/34: v4l2 driver version 0.2.14 loaded
[   13.574429] ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 16
[   13.586329] saa7133[0]: found at 0000:02:00.0, rev: 209, irq: 16, latency: 84, mmio: 0xfddff000
[   13.586727] ieee1394: Host added: ID:BUS[0-00:1023]  GUID[0010dc000152c873]
[   13.599616] saa7133[0]: subsystem: 16be:000d, board: Medion Md8800 Quadro [card=96,autodetected]
[   13.612905] saa7133[0]: board init: gpio is 0
[   13.777868] saa7133[0]: i2c eeprom 00: be 16 0d 00 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
[   13.790508] saa7133[0]: i2c eeprom 10: 00 ff 86 0f ff 20 ff 00 01 50 32 79 01 3c ca 50
[   13.803665] saa7133[0]: i2c eeprom 20: 01 40 01 02 02 03 01 00 06 ff 00 29 02 51 96 2b
[   13.817402] saa7133[0]: i2c eeprom 30: a7 58 7a 1f 03 8e 84 5e da 7a 04 b3 05 87 b2 3c
[   13.831684] saa7133[0]: i2c eeprom 40: ff 28 00 c0 96 10 03 00 c0 1c fd 79 44 9f c2 8f
[   13.846222] saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.861323] saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.876934] saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.892723] saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.904969] saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.917034] saa7133[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.929070] saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.932736] saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.932740] saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.932744] saa7133[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.932748] saa7133[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   ...
From: Andrew Morton
Date: Wednesday, April 30, 2008 - 8:29 am

They always are ;)  Watch this....

--- a/drivers/media/video/tuner-core.c~drivers-media-video-tuner-corec-tuner_probe-fix-error-check
+++ a/drivers/media/video/tuner-core.c
@@ -1181,7 +1181,7 @@ static int tuner_probe(struct i2c_client
 		case 0x60:
 			if (tuner_symbol_probe(tea5767_autodetection,
 					       t->i2c->adapter, t->i2c->addr)
-					!= EINVAL) {
+					!= -EINVAL) {
 				t->type = TUNER_TEA5767;
 				t->mode_mask = T_RADIO;
 				t->mode = T_STANDBY;
_

--

From: Andrew Morton
Date: Wednesday, April 30, 2008 - 8:34 am

I worry about this case:

		case 0x42:
		case 0x43:
		case 0x4a:
		case 0x4b:
			/* If chip is not tda8290, don't register.
			   since it can be tda9887*/
			if (tuner_symbol_probe(tda829x_probe, t->i2c->adapter,
					       t->i2c->addr) == 0) {
				tuner_dbg("tda829x detected\n");
			} else {
				/* Default is being tda9887 */
				t->type = TUNER_TDA9887;
				t->mode_mask = T_RADIO | T_ANALOG_TV |
					       T_DIGITAL_TV;
				t->mode = T_STANDBY;
				goto register_client;
			}
			break;

did we really want to go ahead and perform registration if
tuner_symbol_probe() failed?


--

From: Michael Krufky
Date: Wednesday, April 30, 2008 - 8:39 am

On Wed, Apr 30, 2008 at 11:34 AM, Andrew Morton


Yes -- if the tda829x_probe fails, then we know it is a tda9887, and
we register as such.  This section of the code is fine.


...and about your previous fix:

 --- a/drivers/media/video/tuner-core.c~drivers-media-video-tuner-corec-tuner_probe-fix-error-check
+++ a/drivers/media/video/tuner-core.c
@@ -1181,7 +1181,7 @@ static int tuner_probe(struct i2c_client
                case 0x60:
                        if (tuner_symbol_probe(tea5767_autodetection,
                                               t->i2c->adapter, t->i2c->addr)
-                                       != EINVAL) {
+                                       != -EINVAL) {
                                t->type = TUNER_TEA5767;
                                t->mode_mask = T_RADIO;
                                t->mode = T_STANDBY;


I think we're better off testing for >= 0.  Any < 0 should be
considered a failure.

Regards,

Mike
--

From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 9:01 am

I tried it anyway, still went boom.

	-Mike

--

From: Mauro Carvalho Chehab
Date: Wednesday, April 30, 2008 - 8:48 am

On Wed, 30 Apr 2008 08:34:35 -0700

The switch() is used to autodetect some tuners. If tuner is not autodetected,
then, driver should register it, but keeping type as TUNER_ABSENT, and wait for
the main driver to properly configure the tuner.

So, the logic is correct.

Cheers,
Mauro
--

From: Mauro Carvalho Chehab
Date: Wednesday, April 30, 2008 - 8:25 am

Hi Mike,

On Wed, 30 Apr 2008 15:03:12 +0200

There are two different issues here. The first one is not finding the symbol.
This is weird. Here, everything looks ok:

[ 3929.936478] Linux video capture interface: v2.00
[ 3929.948852] saa7130/34: v4l2 driver version 0.2.14 loaded
[ 3929.949245] saa7133[0]: found at 0000:06:00.0, rev: 209, irq: 20, latency: 64, mmio: 0x8c000000
[ 3929.949439] saa7133[0]: subsystem: 4e42:3502, board: LifeView FlyDVB-T Hybrid Cardbus/MSI TV @nywhere A/D NB [card=94,autodetected]
[ 3929.949673] saa7133[0]: board init: gpio is 10000
[ 3930.034191] saa7133[0]: i2c eeprom 00: 42 4e 02 35 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
[ 3930.034244] saa7133[0]: i2c eeprom 10: 00 00 62 08 ff 20 ff ff ff ff ff ff ff ff ff ff
[ 3930.034312] saa7133[0]: i2c eeprom 20: 01 40 01 03 03 01 01 03 08 ff 01 eb ff ff ff ff
[ 3930.034380] saa7133[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.034448] saa7133[0]: i2c eeprom 40: ff 21 00 c2 96 10 05 01 01 16 32 15 ff ff ff ff
[ 3930.034517] saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.034584] saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.034653] saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.034721] saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.034788] saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.034857] saa7133[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.034926] saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.034995] saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.035063] saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.035133] saa7133[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3930.035202] saa7133[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ ...
From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 8:48 am

Different oops.

[   12.902828] saa7130/34: v4l2 driver version 0.2.14 loaded
[   12.912627] ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 16
[   12.924485] saa7133[0]: found at 0000:02:00.0, rev: 209, irq: 16, latency: 84, mmio: 0xfddff000
[   12.937653] saa7133[0]: subsystem: 16be:000d, board: Medion Md8800 Quadro [card=96,autodetected]
[   12.950974] saa7133[0]: board init: gpio is 0
[   13.114915] saa7133[0]: i2c eeprom 00: be 16 0d 00 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
[   13.127996] saa7133[0]: i2c eeprom 10: 00 ff 86 0f ff 20 ff 00 01 50 32 79 01 3c ca 50
[   13.141256] saa7133[0]: i2c eeprom 20: 01 40 01 02 02 03 01 00 06 ff 00 29 02 51 96 2b
[   13.155298] saa7133[0]: i2c eeprom 30: a7 58 7a 1f 03 8e 84 5e da 7a 04 b3 05 87 b2 3c
[   13.169896] saa7133[0]: i2c eeprom 40: ff 28 00 c0 96 10 03 00 c0 1c fd 79 44 9f c2 8f
[   13.185133] saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189136] saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189140] saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189144] saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189148] saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189151] saa7133[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189155] saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189159] saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189163] saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189167] saa7133[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.189171] saa7133[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.424687] TUNER: Unable to find symbol tda829x_probe()
[   13.432752] tuner' 1-004b: chip found @ 0x96 (saa7133[0])
[   13.445868] DVB: Unable to find symbol ...
From: Mauro Carvalho Chehab
Date: Wednesday, April 30, 2008 - 9:12 am

On Wed, 30 Apr 2008 17:48:10 +0200

Detach order were wrong.

Try this, please.

diff -r d05d249a98a7 linux/drivers/media/video/cx88/cx88-dvb.c
--- a/linux/drivers/media/video/cx88/cx88-dvb.c	Wed Apr 30 12:45:00 2008 -0300
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c	Wed Apr 30 13:09:51 2008 -0300
@@ -516,8 +516,8 @@
 	if (!fe) {
 		printk(KERN_ERR "%s/2: xc3028 attach failed\n",
 		       dev->core->name);
+		dvb_unregister_frontend(dev->dvb.frontend);
 		dvb_frontend_detach(dev->dvb.frontend);
-		dvb_unregister_frontend(dev->dvb.frontend);
 		dev->dvb.frontend = NULL;
 		return -EINVAL;
 	}
diff -r d05d249a98a7 linux/drivers/media/video/saa7134/saa7134-dvb.c
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c	Wed Apr 30 12:45:00 2008 -0300
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c	Wed Apr 30 13:09:51 2008 -0300
@@ -1345,8 +1345,8 @@
 	return ret;
 
 dettach_frontend:
+	dvb_unregister_frontend(dev->dvb.frontend);
 	dvb_frontend_detach(dev->dvb.frontend);
-	dvb_unregister_frontend(dev->dvb.frontend);
 	dev->dvb.frontend = NULL;
 
 	return -1;

Cheers,
Mauro
--

From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 9:31 am

[   13.552565] saa7130/34: v4l2 driver version 0.2.14 loaded
[   13.566864] hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...
[   13.613250] ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 16
[   13.627572] saa7133[0]: found at 0000:02:00.0, rev: 209, irq: 16, latency: 84, mmio: 0xfddff000
[   13.640970] saa7133[0]: subsystem: 16be:000d, board: Medion Md8800 Quadro [card=96,autodetected]
[   13.655597] saa7133[0]: board init: gpio is 0
[   13.819782] saa7133[0]: i2c eeprom 00: be 16 0d 00 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
[   13.833102] saa7133[0]: i2c eeprom 10: 00 ff 86 0f ff 20 ff 00 01 50 32 79 01 3c ca 50
[   13.846870] saa7133[0]: i2c eeprom 20: 01 40 01 02 02 03 01 00 06 ff 00 29 02 51 96 2b
[   13.861549] saa7133[0]: i2c eeprom 30: a7 58 7a 1f 03 8e 84 5e da 7a 04 b3 05 87 b2 3c
[   13.876947] saa7133[0]: i2c eeprom 40: ff 28 00 c0 96 10 03 00 c0 1c fd 79 44 9f c2 8f
[   13.893136] saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.906301] saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.920147] saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.934434] saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.949006] saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.963781] saa7133[0]: i2c eeprom a0:<7>ieee1394: Host added: ID:BUS[0-00:1023]  GUID[0010dc000152c873]
[   13.979917]  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.990784] saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.004791] saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.018891] saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.032819] saa7133[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.046597] saa7133[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   14.106836] ...
From: Mauro Carvalho Chehab
Date: Wednesday, April 30, 2008 - 2:35 pm

On Wed, 30 Apr 2008 18:31:09 +0200

Ok, I found a way to simulate the error here. Just doing:
	rm  /lib/modules/`uname -r`/kernel/drivers/media/common/tuners/*

Produced the same OOPS.

The fix is easy: just removing the unregister function call. dvb_register
happens only at videobuf-dvb, that happens only if no error during attach. So,
the proper deallocation code is just calling dvb_detach.

By removing this, and the tuner modules, now no oops is generated:

[ 5399.093624] TUNER: Unable to find symbol tda829x_probe()
[ 5399.093638] tuner' 1-004b: chip found @ 0x96 (saa7133[0])
[ 5399.110946] DVB: Unable to find symbol tda9887_attach()
[ 5399.110955] tuner' 1-004b: Tuner attach for type = 74 failed.
[ 5399.119272] tuner' 1-004b: TUNER_SET_TYPE_ADDR
[ 5399.119284] tuner' 1-004b: Calling set_type_addr for type=54, addr=0xff, mode=0x0e, config=0x00
[ 5399.119294] tuner' 1-004b: set addr discarded for type 4, mask 0. Asked to change tuner at addr 0xff, with mask e
[ 5399.119307] tuner' 1-004b: VIDIOC_S_STD
[ 5399.119321] tuner' 1-004b: switching to v4l2
[ 5399.119330] tuner' 1-004b: VIDIOC_S_STD
[ 5399.120762] saa7133[0]: registered device video0 [v4l2]
[ 5399.120873] saa7133[0]: registered device vbi0
[ 5399.120942] saa7133[0]: registered device radio0
[ 5399.121320] tuner' 1-004b: TUNER_SET_STANDBY
[ 5399.145012] saa7134 ALSA driver for DMA sound loaded
[ 5399.145098] saa7133[0]/alsa: saa7133[0] at 0x8c000000 irq 20 registered as card -1
[ 5399.260248] tuner' 1-004b: VIDIOC_S_STD
[ 5399.187606] tuner' 1-004b: TUNER_SET_STANDBY
[ 5399.297878] DVB: Unable to find symbol tda827x_attach()
[ 5399.297886] saa7133[0]/dvb: no tda827x tuner found at addr: 61

I tried even to run userspace apps:

$ scandvb /home/v4l/dvb-apps/util/scan/dvb-t/uk-Storeton
scanning /home/v4l/dvb-apps/util/scan/dvb-t/uk-Storeton
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
main:2248: FATAL: failed to open '/dev/dvb/adapter0/frontend0': 2 No such file or directory

(to test ...
From: Trent Piepho
Date: Wednesday, April 30, 2008 - 2:52 pm

Should the symbol_put be done at all?  When I wrote the code this is based
on, it would check if FUNCTION failed or not.  If it failed, the symbol was
put.  But if it worked, then one was returned a handle into FUNCTION's
module, and so the symbol was not put.  If it was, the module's refcount
would be zero but the caller would have a handle into the module.

So if FUNCTION does anything that creates references to the module, and it
doesn't inc it's own refcount, then the symbol_put shouldn't be done.
--

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

Trent,

The symbol_put is correct in this case.  This macro above is called 
"tuner_symbol_probe" , used only within tuner-core.c

This macro is used to call the probe function of a tuner sub-module 
(tea5761, tea5767, tda8290).  Regardless of whether the probe succeeds 
or fails, we do the symbol_put.  If the probe succeeds, tuner-core will 
proceed to dvb_attach(that_tuner_attach, params), which does the actual 
module use count increase.

Regards,

Mike
--

From: Sam Ravnborg
Date: Wednesday, April 30, 2008 - 2:26 am

So you did not have to do a make clean to make it build?
If make clean is needed then we have an issue in kbuild.

	Sam
--

From: Mike Galbraith
Date: Wednesday, April 30, 2008 - 2:40 am

I would have _sworn_ I did, but am unsure now.  (if so, someone else
will hit it)

	-Mike

--

From: Ingo Molnar
Date: Wednesday, April 30, 2008 - 3:36 am

btw., this second fix might be related to that failure:

  http://lkml.org/lkml/2008/4/30/108

	Ingo
--

From: Sam Ravnborg
Date: Wednesday, April 30, 2008 - 2:25 am

drivers/media is special because it does not contain any files.
Kbuild will generate a built-in.o file only if there is
a chance for a .o file in the directory.

When all media is modules kbuild does not know enough
to say that a built-in.o is needed in drivers/media/
and the workaround to do a obj-y := common/
is the best way to do so.

We had a similar issue in driver/video once I think.
But here we solved it with the kconfig dependency.
If we only say obj-m += media/ then
kbuild will not try to link a built-in.o.
But if we say obj-y += media/ then kbuild will
expect to find a built-in.o in media/

	Sam
--

From: Ingo Molnar
Date: Wednesday, April 30, 2008 - 2:37 am

ok, good. Should be an exceedingly rare situation, we dont have _that_ 
many driver sub-trees.

Can we take this as a:

  Acked-by: Sam Ravnborg <sam@ravnborg.org>

? :-)

	Ingo
--

From: Sam Ravnborg
Date: Wednesday, April 30, 2008 - 2:55 am

Yes.

	Sam
--

From: Patrick Boettcher
Date: Wednesday, April 30, 2008 - 1:02 am

Hi Mauro,

sorry to say that now and not earlier, but:


The mt2266 is a zero-IF (baseband) tuner. I think there is no analog 
decoder for this kind of tuners.

Maybe the move was not necessary, but maybe all tuners should go to 
common.

Patrick.

--
   Mail: patrick.boettcher@desy.de
   WWW:  http://www.wi-bw.tfh-wildau.de/~pboettch/
--

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

Hi Patrick

On Wed, 30 Apr 2008 10:02:43 +0200 (CEST)

Ah, ok. I'm not 100% sure, but I think some chips, like cx88 could theoretically

Good point. 

It seems easier to maintain if we should move all terrestrial/cable [1]
(analog and/or digital) tuners into common/tuners. 

Cheers,
Mauro


[1] I don't see any technical sense of moving satellite tuners, except for
having just one place for all tuners, or if there are some tendency of hybrid
satellite/terrestrial tuners.
--

Previous thread: [PATCH] libata.h: reorganize ata_device a bit by Jeff Garzik on Tuesday, April 29, 2008 - 2:50 pm. (1 message)

Next thread: [git patches] libata fixes by Jeff Garzik on Tuesday, April 29, 2008 - 3:09 pm. (1 message)