Skip to contentSkip to conversation

i2c, lm_sensors, and 2.4.22

DISCUSSION Jean Delvare 2 participants 6 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines

I guess I am quick. I did however patch the kernel (2.4.22) with the cumulative patch provided and noticed that my BTTV device started giving Segmentation Faults (like it did in 2.4.21 without your patch). I'm not sure of what's wrong, but I can provide some more info if you need (or want) it to try to fix the problem.

I'm a bit astonished since I have been having success reports by other users. Another thing I am wondering about is why you say the patches are cumulative. My patches are *not* cumulative. There are two different (big) patches, one for 2.4.21, one for 2.4.22. You really have to start from a fresh 2.4.22 tree before applying the new 2.4.22 patch. If you thing my page is unclear about that, let me know and I'll add details where they are needed.

If you still can't get it to work, please detail which procedure you are using, and in particular where you do get your source tree from, how you apply my patch and which patch or set of patches it is, wether the patch command returns warnings, wether the compilation then returns warnings, and so on.

I myself tried the new 2.4.22 patch with my DC10+ and it worked OK. If something's wrong, it must be something specific to the BTTV modules.

Quoted 38 lines · Jean Delvare
Quoted 15 lines
Quoted 5 lines

I saw that you updated

http://www.ensicaen.ismra.fr/~delvare/devel/i2c

Yeah, you're quick, the updated wasn't even finished ;)

Quoted 3 lines

to include the patch for 2.4.22. However, it seems that the permissions aren't set right on the file because I get a "Forbidden" message in my browser when trying to access it.

I moved the patches into subdirectories and forgot to update all links in the web page. That's all fixed now.

Quoted 11 lines

I tested the whole think quickly and it seems to work. More testing will be welcome of course, since I just don't have the time to fully test everything. I'm *very* busy these days (taking a new job tomorrow)...

Thanks for your patience and let me know how it works for you! :)

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

#####################################################################
######

Troy Henderson                  Office: Blocker Building 619
Department of Mathematics       Phone : (979) 845-7769
Texas A&M University            E-mail: [email protected]
College Station, TX 77845       URL   :

http://www.math.tamu.edu/~thenders
#####################################################################
######

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#1 lore raw

Jean,

I appologize for the false alarm. It seems that other BTTV software was able to handle it just fine. It must have just been a problem with XAWTV. Anyway, thanks for the response. By the way, have you noticed whether or not these changes have been incorporated into 2.4.23(pre) yet? Any chance they will show up in the final 2.4.23 version?

Thanks,

Troy

Quoted 52 lines · Jean Delvare
Quoted 6 lines

I guess I am quick. I did however patch the kernel (2.4.22) with the cumulative patch provided and noticed that my BTTV device started giving Segmentation Faults (like it did in 2.4.21 without your patch). I'm not sure of what's wrong, but I can provide some more info if you need (or want) it to try to fix the problem.

I'm a bit astonished since I have been having success reports by other users. Another thing I am wondering about is why you say the patches are cumulative. My patches are *not* cumulative. There are two different (big) patches, one for 2.4.21, one for 2.4.22. You really have to start from a fresh 2.4.22 tree before applying the new 2.4.22 patch. If you thing my page is unclear about that, let me know and I'll add details where they are needed.

If you still can't get it to work, please detail which procedure you are using, and in particular where you do get your source tree from, how you apply my patch and which patch or set of patches it is, wether the patch command returns warnings, wether the compilation then returns warnings, and so on.

I myself tried the new 2.4.22 patch with my DC10+ and it worked OK. If something's wrong, it must be something specific to the BTTV modules.

Quoted 28 lines · Jean Delvare
Quoted 26 lines
Quoted 5 lines

I saw that you updated

http://www.ensicaen.ismra.fr/~delvare/devel/i2c

Yeah, you're quick, the updated wasn't even finished ;)

Quoted 3 lines

to include the patch for 2.4.22. However, it seems that the permissions aren't set right on the file because I get a "Forbidden" message in my browser when trying to access it.

I moved the patches into subdirectories and forgot to update all links in the web page. That's all fixed now.

I tested the whole think quickly and it seems to work. More testing will be welcome of course, since I just don't have the time to fully test everything. I'm *very* busy these days (taking a new job tomorrow)...

Thanks for your patience and let me know how it works for you! :)

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
Quoted 16 lines
Quoted 10 lines

#####################################################################
######

Troy Henderson                  Office: Blocker Building 619
Department of Mathematics       Phone : (979) 845-7769
Texas A&M University            E-mail: [email protected]
College Station, TX 77845       URL   :

http://www.math.tamu.edu/~thenders
#####################################################################
######

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

##########################################################################

Troy Henderson                  Office: Blocker Building 619
Department of Mathematics       Phone : (979) 845-7769
Texas A&M University            E-mail: [email protected]
College Station, TX 77845       URL   : http://www.math.tamu.edu/~thenders

##########################################################################

#2 lore raw
In reply to Jean Delvare
Quoted 4 lines

I appologize for the false alarm. It seems that other BTTV software was able to handle it just fine. It must have just been a problem with XAWTV. Anyway, thanks for the response.

If XawTV can crash our modules, and wether or not other programs do, that's still bad, and that's still our fault. I will try again with my own Miro PCTV Pro as soon as possible (but that's at least one week and probably more) with XawTV (which I always use BTW) and see if I can get it to crash.

Quoted 3 lines

By the way, have you noticed whether or not these changes have been incorporated into 2.4.23(pre) yet? Any chance they will show up in the final 2.4.23 version?

They sure have not been, for "everyone" is waiting for me to write a clean patch and submit it. I (and with me, the whole LM Sensors team and most users) really would like our new i2c subsystem incorporated into 2.4.23, because the more we wait, the more conflicts are likely to happen with other merges, and the more work I have.

The next step at the moment is to release i2c-2.8.1, and that's not my job (which is great because I wouldn't have the time). Hopefully it will happen within the next few days, and I'll submit a patch to the LKML a few days later. So please be patient and go on testing :)

Thanks.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#3 lore raw
In reply to Jean Delvare
Quoted 50 lines

Jean,

I successfully used your patch for kernel 2.4.22 to build i2c into the kernel for lm_sensors. I noticed, however, that there's a mkpatch/mkpatch.pl in the i2c CVS tree. However, when I use this to generate my patch instead of the one you provided, the patch works correctly, however I get kernel compilation erros that read as
(...)
gcc -D__KERNEL__ -I/usr/src/linux-2.4.22/include -Wall

(quoted diff) +0 -8
-Wstrict-prototypes 
-Wno- trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer 
-pipe -mpref erred-stack-boundary=2 -march=athlon -DMODULE
-DMODVERSIONS 
-include /usr/src/li nux-2.4.22/include/linux/modversions.h 
-nostdinc 
-iwithprefix include -DKBUILD_ BASENAME=bttv_if  -DEXPORT_SYMTAB -c 

bttv-if.c
bttv-if.c:244: error: unknown field `inc_use' specified in initializer
bttv-if.c:244: warning: initialization from incompatible pointer type
bttv-if.c:245: error: unknown field `dec_use' specified in initializer
bttv-if.c:245: warning: missing braces around initializer bttv-if.c:245: warning: (near initialization for `bttv_i2c_adap_template.name')
bttv-if.c:245: warning: initialization makes integer from pointer without
a cast
bttv-if.c:245: error: initializer element is not computable at load time
bttv-if.c:245: error: (near initialization for `bttv_i2c_adap_template.name[0]')
bttv-if.c:246: error: initializer element is not constant bttv-if.c:246: error: (near initialization for `bttv_i2c_adap_template.name')
make[3]: *** [bttv-if.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.22/drivers/media/video'
make[2]: *** [_modsubdir_video] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4.22/drivers/media' make[1]: *** [_modsubdir_media] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.22/drivers'
make: *** [_mod_drivers] Error 2
(...)
I'm not sure what's causing this. Do you have any insight. I did the following to produce my patched kernel for i2c and lm_sensors

Quoted 8 lines

cd /usr/src/linux-2.4.22
$I2C_PATH/mkpatch/mkpatch.pl $I2C_PATH . | patch -p1 $LM_SENSORS_PATH/mkpatch/mkpatch.pl $LM_SENSORS_PATH . | patch -p1

and both patches went through correctly. However, something's obviously wrong becuase bttv fails to compile.

Any help on this would be much appreciated.

Hi Troy,

Well, that's easy. My patch is simply the one generated by i2c's mkpatch.pl, plus a set of additional patches that fix compatibility issues. This is the exact reason why I am building my patches - because they are better than what mkpatch.pl does.

So, you are invited to use my script for the i2c part, and mkpatch.pl for the lm_sensors part. This will give you a perfectly working kernel. If not, let me know and I'll fix whatever needs to be.

We hope to have my patches incorporated into Linux 2.4.23, so that people won't have to get them by themselves anymore.

Signature · 5 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
#4 lore raw
In reply to Jean Delvare
Quoted 9 lines

Thanks for the reply. I'd like to know where to locate your script. I assume that this script is similar to the mkpatch.pl provided by i2c in that it will generate the appropriate patch for any kernel. Is this script on

http://www.ensicaen.ismra.fr/~delvare/devel/i2c

or is it somewhere else?

There is no script (TM). Patches had to be written one by one, "by hand". I modify them individually each time a new 2.4 kernel is released (which happened only once so far, for the 2.4.22 kernel). If you need to patch a kernel that is not supported (that is, neither 2.4.21 nor 2.4.22), here is how to proceed.

1* Use i2c's mkpatch.pl to generate the core patch for your kernel, and apply it.

2* Apply each additional patch individually. You'll find them here:
http://www.ensicaen.ismra.fr/~delvare/devel/i2c/#list
You'll want to apply all the patches but "core i2c subsystem", since you'll already have done this part. Wether you'll use the patches intended for linux 2.4.21 or 2.4.22 depends on which kernel you are targetting. The nearest, the more likely the patches are likely to apply cleanly. If they don't, you'll have to dig into the code ;)

I'd like to underline that all this is already mentioned on my webpage. If you think that some details should be added or some changes made to make things clearer, let me know.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#5 lore raw
In reply to Jean Delvare

Jean,

Thanks for the reply. I'd like to know where to locate your script. I assume that this script is similar to the mkpatch.pl provided by i2c in that it will generate the appropriate patch for any kernel. Is this script on

http://www.ensicaen.ismra.fr/~delvare/devel/i2c

or is it somewhere else?

Thanks,

Troy

Quoted 66 lines · Jean Delvare
Quoted 50 lines

Jean,

I successfully used your patch for kernel 2.4.22 to build i2c into the kernel for lm_sensors. I noticed, however, that there's a mkpatch/mkpatch.pl in the i2c CVS tree. However, when I use this to generate my patch instead of the one you provided, the patch works correctly, however I get kernel compilation erros that read as
(...)
gcc -D__KERNEL__ -I/usr/src/linux-2.4.22/include -Wall

(quoted diff) +0 -8
-Wstrict-prototypes 
-Wno- trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer 
-pipe -mpref erred-stack-boundary=2 -march=athlon -DMODULE
-DMODVERSIONS 
-include /usr/src/li nux-2.4.22/include/linux/modversions.h 
-nostdinc 
-iwithprefix include -DKBUILD_ BASENAME=bttv_if  -DEXPORT_SYMTAB -c 

bttv-if.c
bttv-if.c:244: error: unknown field `inc_use' specified in initializer
bttv-if.c:244: warning: initialization from incompatible pointer type
bttv-if.c:245: error: unknown field `dec_use' specified in initializer
bttv-if.c:245: warning: missing braces around initializer bttv-if.c:245: warning: (near initialization for `bttv_i2c_adap_template.name')
bttv-if.c:245: warning: initialization makes integer from pointer without
a cast
bttv-if.c:245: error: initializer element is not computable at load time
bttv-if.c:245: error: (near initialization for `bttv_i2c_adap_template.name[0]')
bttv-if.c:246: error: initializer element is not constant bttv-if.c:246: error: (near initialization for `bttv_i2c_adap_template.name')
make[3]: *** [bttv-if.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.22/drivers/media/video'
make[2]: *** [_modsubdir_video] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4.22/drivers/media' make[1]: *** [_modsubdir_media] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.22/drivers'
make: *** [_mod_drivers] Error 2
(...)
I'm not sure what's causing this. Do you have any insight. I did the following to produce my patched kernel for i2c and lm_sensors

Quoted 8 lines

cd /usr/src/linux-2.4.22
$I2C_PATH/mkpatch/mkpatch.pl $I2C_PATH . | patch -p1 $LM_SENSORS_PATH/mkpatch/mkpatch.pl $LM_SENSORS_PATH . | patch -p1

and both patches went through correctly. However, something's obviously wrong becuase bttv fails to compile.

Any help on this would be much appreciated.

Hi Troy,

Well, that's easy. My patch is simply the one generated by i2c's mkpatch.pl, plus a set of additional patches that fix compatibility issues. This is the exact reason why I am building my patches - because they are better than what mkpatch.pl does.

Quoted 14 lines

So, you are invited to use my script for the i2c part, and mkpatch.pl for the lm_sensors part. This will give you a perfectly working kernel. If not, let me know and I'll fix whatever needs to be.

We hope to have my patches incorporated into Linux 2.4.23, so that people won't have to get them by themselves anymore.

Signature · 5 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

##########################################################################

Troy Henderson                  Office: Blocker Building 619
Department of Mathematics       Phone : (979) 845-7769
Texas A&M University            E-mail: [email protected]
College Station, TX 77845       URL   : http://www.math.tamu.edu/~thenders

##########################################################################