Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
mzOffline
15 Post subject: [FIXED] I2C write failure in kernel 2.6.36-1.slh.2-apto...  PostPosted: 27.11.2010, 23:56



Joined: 2010-09-11
Posts: 56

Status: Offline
I have a DViCO FusionHDTV7 Dual Express card that works with 2.6.35-4.slh.9-aptosid-amd64 but which fails to initialize with the latest 2.6.36 kernel. The firmware fails to load due to an i2c failure.

Here is the dmesg from 2.6.35, for the two tuners:
      Code:

[   89.949557] xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)...
[   89.984717] xc5000: firmware read 12401 bytes.
[   89.984723] xc5000: firmware uploading...
[   91.531020] xc5000: firmware upload complete...
[  106.721182] xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)...
[  106.728604] xc5000: firmware read 12401 bytes.
[  106.728610] xc5000: firmware uploading...
[  108.281021] xc5000: firmware upload complete...


and here is what happens with 2.6.36:

      Code:

[   94.474238] xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)...
[   94.510369] xc5000: firmware read 12401 bytes.
[   94.510375] xc5000: firmware uploading...
[   94.713179] xc5000: I2C write failed (len=3)
[   94.713181] xc5000: firmware upload complete...
[   94.713190] xc5000: Unable to initialise tuner
[   94.719936] xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)...
[   94.723828] xc5000: firmware read 12401 bytes.
[   94.723831] xc5000: firmware uploading...
[   94.924012] xc5000: I2C write failed (len=3)
[   94.924014] xc5000: firmware upload complete...

and it keeps trying about 10 more times.


Last edited by mz on 16.02.2011, 05:23; edited 2 times in total
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-amd64  PostPosted: 28.11.2010, 00:15



Joined: 2010-08-25
Posts: 724

Status: Offline
I'll try to upload a 2.6.36 based test kernel with "V4L/DVB: xc5000, rework xc_write_reg" (quite fundamental rewrite of the i2c based register access for this driver) reverted over the next few days, which might help. However this issue needs to be raised upstream before 2.6.37, as this rewrite is apparently needed to support newer devices (and is claimed to be tested with tm6000 and saa7134).
 
 View user's profile Send private message  
Reply with quote Back to top
mzOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-amd64  PostPosted: 28.11.2010, 14:53



Joined: 2010-09-11
Posts: 56

Status: Offline
Thank you for building a test kernel for this issue. I would be happy to report this upstream but I have never reported a kernel bug before and it is not immediately obvious where to send it where it will not be ignored.

Major kernel releases seem to be coming a lot more frequently than they used to. 2.6.36 is barely out and there is already a 2.6.37-rc.
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-amd64  PostPosted: 05.12.2010, 22:22



Joined: 2010-08-25
Posts: 724

Status: Offline
Sorry for the delay, my current upload bandwidth is hard to work with. I've uploaded a test kernel to http://aptosid.com/slh/xc5000/, if that one works, you need to contact upstream about it (because I can't revert these changes for 2.6.37). The only differences between this kernel and "ordinary" 2.6.36 kernels is the reversion of these two patches to xc5000:
      Code:
commit 1cdffda73fb70b211be5b1c2428ddea4f9a223ea
Author: Mauro Carvalho Chehab <mchehab>
Date:   Mon Jul 5 18:38:46 2010 -0300

    V4L/DVB: xc5000: Fix a few warnings
   
    drivers/media/common/tuners/xc5000.c: In function ‘xc_write_reg’:
    drivers/media/common/tuners/xc5000.c:298: warning: passing argument 3 of ‘xc5000_readreg’ from incompatible pointer type
    drivers/media/common/tuners/xc5000.c:235: note: expected ‘u16 *’ but argument is of type ‘u8 *’
    drivers/media/common/tuners/xc5000.c: At top level:
    drivers/media/common/tuners/xc5000.c:223: warning: ‘xc_read_i2c_data’ defined but not used
   
    Signed-off-by: Mauro Carvalho Chehab <mchehab>

commit 4743319fb0d2a808a5e3eeb778a9666daf9da51d
Author: Dmitri Belimov <d>
Date:   Tue May 18 04:30:11 2010 -0300

    V4L/DVB: xc5000, rework xc_write_reg
   
    Rework xc_write_reg function for correct read register of the xc5000.
    It is very useful for tm6000.
   
    Tested for tm6000 and for saa7134 works well.
   
    Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d>
    Acked-by: Devin Heitmueller <dheitmueller>
    Signed-off-by: Mauro Carvalho Chehab <mchehab>
 
 View user's profile Send private message  
Reply with quote Back to top
mzOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-amd64  PostPosted: 06.12.2010, 05:37



Joined: 2010-09-11
Posts: 56

Status: Offline
Thanks for building a test kernel. Unfortunately I still have the same symptoms.
      Code:

qpc$ dmesg | tail
[   88.508902] xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)...
[   88.516291] xc5000: firmware read 12401 bytes.
[   88.516297] xc5000: firmware uploading...
[   88.718323] xc5000: I2C write failed (len=3)
[   88.718326] xc5000: firmware upload complete...
[   89.722887] xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)...
[   89.730237] xc5000: firmware read 12401 bytes.
[   89.730243] xc5000: firmware uploading...
[   89.932298] xc5000: I2C write failed (len=3)
[   89.932302] xc5000: firmware upload complete...
qpc$ uname -a
Linux qpc 2.6.36-1.slh.3.9-aptosid-amd64 #1 SMP PREEMPT Sun Dec 5 21:57:16 UTC 2010 x86_64 GNU/Linux


I will try reporting this upstream and see what happens.
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-amd64  PostPosted: 06.12.2010, 13:21



Joined: 2010-08-25
Posts: 724

Status: Offline
Hmm, those were the only changes to xc5000 between 2.6.35 and 2.6.36, although it's certainly possible that the underlying infrastructure changed elsewere as well...

The ideal way to debug this would be a git bisect between 2.6.35 and 2.6.36, but that would require you to compile several intermediate kernels recursively, depending on the result of each iteration.
 
 View user's profile Send private message  
Reply with quote Back to top
mzOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-amd64  PostPosted: 08.12.2010, 02:47



Joined: 2010-09-11
Posts: 56

Status: Offline
Reported this to linux-media@vger.kernel.org. I'll see about compiling their latest drivers.
 
 View user's profile Send private message  
Reply with quote Back to top
mzOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-amd64  PostPosted: 10.01.2011, 02:21



Joined: 2010-09-11
Posts: 56

Status: Offline
No real progress on this yet, but I found that the issue still exists in 2.6.37. So, I built my own 2.6.37 kernel and enabled these options to get more information:
      Code:
CONFIG_I2C_DEBUG_CORE=y                                                         
CONFIG_I2C_DEBUG_ALGO=y
CONFIG_I2C_DEBUG_BUS=y

With this change, the firmware loaded properly so I still have no clear reason for the problem. I suspect a race condition or maybe a hard coded timeout that needs to be changed.
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-amd64  PostPosted: 10.01.2011, 03:09



Joined: 2010-08-25
Posts: 724

Status: Offline
Debugging options have a tendency to slightly affect timing, which might introduce just enough latency to let the device succeed instead of failing; this doesn't change the fact that a bug like that needs to be fixed in the driver.
 
 View user's profile Send private message  
Reply with quote Back to top
mzOffline
Post subject: Re: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-a  PostPosted: 30.01.2011, 15:33



Joined: 2010-09-11
Posts: 56

Status: Offline
      slh wrote:
The ideal way to debug this would be a git bisect between 2.6.35 and 2.6.36, but that would require you to compile several intermediate kernels recursively, depending on the result of each iteration.


I think I will have to resort to this, since squinting at code has been fruitless. Currently researching what 'git bisect' means and how to do it.
 
 View user's profile Send private message  
Reply with quote Back to top
mzOffline
Post subject: Re: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptosid-a  PostPosted: 07.02.2011, 05:31



Joined: 2010-09-11
Posts: 56

Status: Offline
      mz wrote:
      slh wrote:
The ideal way to debug this would be a git bisect between 2.6.35 and 2.6.36, but that would require you to compile several intermediate kernels recursively, depending on the result of each iteration.


I think I will have to resort to this, since squinting at code has been fruitless. Currently researching what 'git bisect' means and how to do it.


This is harder than it sounds. I have been unable to build any intermediate kernels because of errors like this:
      Code:
  Building modules, stage 2.
  MODPOST 2676 modules
ERROR: "st_get_plat_device" [drivers/staging/ti-st/st_drv.ko] undefined!
WARNING: modpost: Found 77 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'

Building with CONFIG_DEBUG_SECTION_MISMATCH=y has not provided information that is useful to me. It is as if very few intermediate states of the git tree are buildable, but this seems unlikely, so I must be doing something wrong. But what?
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: Re: RE: I2C write failure in kernel 2.6.36-1.slh.2-aptos  PostPosted: 07.02.2011, 13:01



Joined: 2010-08-25
Posts: 724

Status: Offline
Just disable staging alltogether, it's not essential/ necessary for debugging your particular problem and the mere reason for stuff being in staging, is it being of questionable quality.
 
 View user's profile Send private message  
Reply with quote Back to top
mzOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-a  PostPosted: 07.02.2011, 14:26



Joined: 2010-09-11
Posts: 56

Status: Offline
      slh wrote:
Just disable staging altogether, it's not essential/ necessary for debugging your particular problem and the mere reason for stuff being in staging, is it being of questionable quality.

OK, that makes sense. I am looking for a command like 'git disable staging' but it is not obvious.
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-a  PostPosted: 07.02.2011, 15:44



Joined: 2010-08-25
Posts: 724

Status: Offline
make menuconfig|xconfig|gconfig
 
 View user's profile Send private message  
Reply with quote Back to top
mzOffline
Post subject: RE: I2C write failure in kernel 2.6.36-1.slh.2-a  PostPosted: 08.02.2011, 04:05



Joined: 2010-09-11
Posts: 56

Status: Offline
Thanks; that was amazing. Looking in the right place makes all the difference. It looks like I have about 12 kernels to go.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio