Skip to contentSkip to conversation

Soc-camera and 2.6.33

DISCUSSION Robert Jarzmik 2 participants 5 messages May 31, 2010 – Jun 1, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

I tried to upgrade from 2.6.30 to 2.6.33 and verify my board (ie. the mt9m111 sensor with pxa_camera host).

I'm a bit surprised it didn't work. I dig just a bit, and found that :
- in soc_camera_init_i2c(), the following call fails

	subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap,
				icl->module_name, icl->board_info, NULL);

I have subdev = NULL.

- as a result, I'm getting that kind of log :
camera 0-0: Probing 0-0
pxa27x-camera pxa27x-camera.0: Registered platform device at c3010900 data c03f0c24 pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0
RJK: subdev=NULL, module=mt9m111
pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0
camera: probe of 0-0 failed with error -12

- if I try 2.6.34, I have no error report, and mt9m111 driver is not probed either.

Is there an explanation as to why I have this regression ? Is something to be done with the v4l2 migration ?

Cheers.

--
Robert

#1 lore raw

Hi Robert

Quoted 9 lines · Robert Jarzmik

I tried to upgrade from 2.6.30 to 2.6.33 and verify my board (ie. the mt9m111 sensor with pxa_camera host).

I'm a bit surprised it didn't work. I dig just a bit, and found that :
- in soc_camera_init_i2c(), the following call fails

	subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap,
				icl->module_name, icl->board_info, NULL);

I have subdev = NULL.

Quoted 7 lines

- as a result, I'm getting that kind of log :
camera 0-0: Probing 0-0
pxa27x-camera pxa27x-camera.0: Registered platform device at c3010900 data c03f0c24 pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0
RJK: subdev=NULL, module=mt9m111
pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0
camera: probe of 0-0 failed with error -12

a lot of things changed in and around soc-camera between 2.6.30 and .33... E.g., previously you could load driver modules in any order, it would work in any case. Now if you load your host driver (pxa) and your client driver is not there yet, it should be automatically loaded. However, if your user-space doesn't support this, it won't work. Can this be the reason gor your problem? Otherwise, I'd suspect a problem with your platform data (cf. other platforms), or, eventually with mt9m111.

Quoted 5 lines

- if I try 2.6.34, I have no error report, and mt9m111 driver is not probed either.

Is there an explanation as to why I have this regression ? Is something to be done with the v4l2 migration ?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

#2 lore raw
Quoted 9 lines · Guennadi Liakhovetski

Hi Robert

a lot of things changed in and around soc-camera between 2.6.30 and .33... E.g., previously you could load driver modules in any order, it would work in any case. Now if you load your host driver (pxa) and your client driver is not there yet, it should be automatically loaded. However, if your user-space doesn't support this, it won't work. Can this be the reason gor your problem? Otherwise, I'd suspect a problem with your platform data (cf. other platforms), or, eventually with mt9m111.

I have a very tiny system :
- udev
- a shell (/bin/ash)
- a libc
- busybox (insmod/modprobe/rmmod/ls)
- capture_example compiled as my testbed

I do :
- insmod mt9m111.ko
- insmod pxa_camera.ko

My userspace hasn't changed since 2.6.30 (constant executables, ARM-EABI). My platform was converted by you in commit a48c24a696f0d93c49f913b7818e9819612b1f4e if I remember correctly.

Any hint for me to track down my problem ?

Cheers.

Signature · 1 line
Robert
#3 lore raw
In reply to Guennadi Liakhovetski
Quoted 7 lines · Guennadi Liakhovetski

a lot of things changed in and around soc-camera between 2.6.30 and .33... E.g., previously you could load driver modules in any order, it would work in any case. Now if you load your host driver (pxa) and your client driver is not there yet, it should be automatically loaded. However, if your user-space doesn't support this, it won't work. Can this be the reason gor your problem? Otherwise, I'd suspect a problem with your platform data (cf. other platforms), or, eventually with mt9m111.

I tracked down the beast ... :)

The problem is with the commit a48c24a696f0d93c49f913b7818e9819612b1f4e "[ARM] pxa/mioa701: convert mioa701 to the new platform-device soc-camera interface".

This is a tricky one ... :
- ic_link is declared normally, and references &mioa701_i2c_devices[0]
- but mioa701_i2c_devices[] is declared as __initdata, and discarded after init if I understand correctly.

This implies that the structure ic_link references something not present anymore, hence my bug. I'm a bit disturbed that the compiler didn't catch that
...

Anyway, now I'll have to send a patch to Eric for that, to remove the "__initdata" specifier from mioa701_i2c_devices[].

Eric, are you still taking in fix patches for the 2.6.35 kernel ?

Cheers.

--
Robert

PS: I checked for other pxa boards, and they don't suffer from my problem.

#4 lore raw
Quoted 10 lines · Robert Jarzmik
Quoted 7 lines · Guennadi Liakhovetski

a lot of things changed in and around soc-camera between 2.6.30 and .33... E.g., previously you could load driver modules in any order, it would work in any case. Now if you load your host driver (pxa) and your client driver is not there yet, it should be automatically loaded. However, if your user-space doesn't support this, it won't work. Can this be the reason gor your problem? Otherwise, I'd suspect a problem with your platform data (cf. other platforms), or, eventually with mt9m111.

Quoted 5 lines

I tracked down the beast ... :)

The problem is with the commit a48c24a696f0d93c49f913b7818e9819612b1f4e "[ARM] pxa/mioa701: convert mioa701 to the new platform-device soc-camera interface".

hm, I would humbly disagree - the "__initdata" was there before that commit. With my conversion I just missed it and noone tested it since then;)

Quoted 8 lines

This is a tricky one ... :
- ic_link is declared normally, and references &mioa701_i2c_devices[0]
- but mioa701_i2c_devices[] is declared as __initdata, and discarded after init if I understand correctly.

This implies that the structure ic_link references something not present anymore, hence my bug.

Nice catch!

Quoted 2 lines

I'm a bit disturbed that the compiler didn't catch that
...

Interesting...

Quoted 4 lines

Anyway, now I'll have to send a patch to Eric for that, to remove the "__initdata" specifier from mioa701_i2c_devices[].

Eric, are you still taking in fix patches for the 2.6.35 kernel ?

Of course, bugfixes must be taken at any time.

Quoted 1 line

PS: I checked for other pxa boards, and they don't suffer from my problem.

And not only PXA.

Thanks for debugging!
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/