Ruud Huynen wrote:

#dmesg|egrep "cx25840|Initialized"
ivtv: Initialized WinTV PVR 350, card #0
cx25840: starting probe for adapter ivtv i2c driver #0 (0x10005) <--- didn't find one

Yeah see, this is where the i2c_enable gets funky in how it numbers cards. The number is only incremented if we find the chip there (via an SMBUS quick mode). This is highly dependant on the order of cards in the system. The only chips this is a problem for are the cx25840 (pvr150/500) and saa7125 (pvr350) because they have two different chips at the same bus address. In your situation: -- PVR-350 comes online. It finds the saa7125 at 0x44, ssa7125's i2c_enabled gets incremented, cx25840's does not (the module isn't even loaded yet) -- PVR150 (500's tuner 0) comes online. saa7125's i2c driver gets first crack at the probe, but since it has a -1 it skips probing. saa7125's i2c_enabled index is now 2 (3rd item). -- -- The cx25840 driver comes up, tries to probe the PVR-350, but the address is in use already. i2c_enabled index is not incremented! -- -- cx25840 tries to probe the pvr150. Found! index is finally incremented. cx25840's index is incremented, now 1 after 2 cards, saa7125's is at *2* after 2 cards.

and so on in that fashion. This can be even further compicated if you load the modules manually:
-- load cx25840
-- load saa7125
-- load ivtv
-- PVR350 found. cx25840 gets first crack, finds a chip at 0x44, i2c_enabled is incremented. Since the chip doesn't ID properly, the 25840 modules should release the address. saa7125 probes and finds its chip at 0x44. saa7125's i2c_enable is icremented too. Note that the i2c_enable indexes are in sync now between the two modules.

After working this out out loud, it becomes obvious that we should check for skip and increment each modules i2c_enabled at the same time we print out "starting probe for adapter ivtv i2c ...". This would occur only if the adapter flags are right (ALGO_BIT | HW_B_BT848) so we don't increment for other busses (like the Intel i810 a lot of us have). I think this would prevent modules' i2c_enabled indexes from getting out of sync depending on module load order and card init order. Am I on base with this? I will submit a patch.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
ivtv-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ivtv-devel

Reply via email to