Skip to contentSkip to conversation

i2c oops

DISCUSSION Jean Delvare 2 participants 5 messages May 19, 2005

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

Sorry for the flood. It seems that I spoke to soon about the i2c patch. After applying the patch, I get the following error on kernel compilation:

ld -m elf_i386 -T /usr/src/linux-2.4.23-rc1/arch/i386/vmlinux.lds -e stext arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o

init/version.o init/do_mounts.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o
        mm/mm.o fs/fs.o ipc/ipc.o \
         drivers/char/char.o drivers/block/block.o drivers/misc/misc.o
         drivers/net/net.o drivers/net/fc/fc.o drivers/atm/atm.o
         drivers/ide/idedriver.o drivers/scsi/scsidrv.o
         drivers/cdrom/driver.o drivers/sound/sounddrivers.o
         drivers/pci/driver.o drivers/video/video.o
         drivers/usb/usbdrv.o drivers/media/media.o
         drivers/input/inputdrv.o drivers/i2c/i2c.o drivers/md/mddev.o
         drivers/sensors/sensor.o \
        net/network.o \
        /usr/src/linux-2.4.23-rc1/arch/i386/lib/lib.a
        /usr/src/linux-2.4.23-rc1/lib/lib.a
        /usr/src/linux-2.4.23-rc1/arch/i386/lib/lib.a \--end-group \
        -o vmlinux
Quoted 3 lines

drivers/i2c/i2c.o(.text+0x4208): In function `vt596_transaction':
: undefined reference to `i2c_delay'
make: *** [vmlinux] Error 1

The i2c_delay was introduced recently (i2c-2.8.1). Which versions of i2c and lm_sensors are you using? Such an error would occur if you used i2c-2.8.0 but lm_sensors 2.8.1, for example.

Please check that /usr/src/linux-2.4.23-rc1/include/linux/i2c.h has the i2c_delay function defined at the end. If it hasn't, this means you failed patching your kernel tree in a proper manner.

Since you obviously patched your kernel, you are advised to use the enhanced i2c patch available here:
http://www.ensicaen.ismra.fr/~delvare/devel/i2c/
which has more than the one mkpatch.pl would produce and will let you use non-sensors i2c drivers as well. The patch replaces the i2c one only, you'll still have to apply the lm_sensors patch after that, based on the same version as i2c.

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

My i2c.h has NO evidence of a function called i2c_delay(). That would explain the error.

Yes, that would. I invite you to take a look at the kernel/i2c.h file in your local i2c CVS copy to make sure you have i2c_delay() there. Then look at the patch you generated and make check that i2c_delay() is there too. Hopefully you will understand where it does go wrong.

Quoted 5 lines

Could you tell me how you generated this patch? Was it using the mkpatch.pl script together with another (maybe more than one) script(s)? The reason that I'm asking is that I'd like to do this myself for any kernel. If I use your patches, I'd have to be using 2.4.21 or 2.4.22.

Using mkpatch.pl and my brain and fingers (and much, much time). The process isn't automated, because hopefully the whole thing should go into the Linux kernel tree someday (although I was told it wouldn't be easy, if even possible). But since I make all individual patches available on my page, you can generate the core patch for your own kernel tree, and then apply all individual patches which shouldn't vary much from kernels to kernels. For 2.4.23-rc1, the media/video patch is known to fail on some files (but this should be harmless, it fails because the required fix is already there in another form), and one new driver (w9968cf) misses its patch - which shouldn't cause any trouble unless you use this very specific driver.

Eventually I'll make a patch available for 2.4.23-rc1 if there are enough requests for such a patch.

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

Yes, that would. I invite you to take a look at the kernel/i2c.h file in your local i2c CVS copy to make sure you have i2c_delay() there. Then look at the patch you generated and make check that i2c_delay() is there too. Hopefully you will understand where it does go wrong.

There's no i2c_delay() in my CVS version of i2c.h either.

So you don't have the latest CVS. I suspect you have some sticky tag set (aren't you by any chance using the deprecated lk2-4 branch?) Start from scratch and it should be OK.

Quoted 6 lines
Quoted 2 lines

Eventually I'll make a patch available for 2.4.23-rc1 if there are enough requests for such a patch.

I was just wanting to get a "good" way to patch 2.4.23 when it comes out so that I wouldn't have to wait for your patches since I know that you're probably pretty darn busy.

I understand. I feel myself ashamed to be so slow updating the patch set, but actually I also have other activities (real life or not) so it takes some time before I can have this done.

I'll let you know when a new patch is available.

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

The i2c_delay was introduced recently (i2c-2.8.1). Which versions of i2c and lm_sensors are you using? Such an error would occur if you used i2c-2.8.0 but lm_sensors 2.8.1, for example.

I am using the CVS of both i2c and lm_sensors. I did a cvs update before applying each of the i2c and lm_sensors patches. So, in theory, I should have the latest version of both.

Quoted 3 lines

Please check that /usr/src/linux-2.4.23-rc1/include/linux/i2c.h has the i2c_delay function defined at the end. If it hasn't, this means you failed patching your kernel tree in a proper manner.

My i2c.h has NO evidence of a function called i2c_delay(). That would explain the error.

Quoted 7 lines

Since you obviously patched your kernel, you are advised to use the enhanced i2c patch available here:
http://www.ensicaen.ismra.fr/~delvare/devel/i2c/
which has more than the one mkpatch.pl would produce and will let you use non-sensors i2c drivers as well. The patch replaces the i2c one only, you'll still have to apply the lm_sensors patch after that, based on the same version as i2c.

Could you tell me how you generated this patch? Was it using the mkpatch.pl script together with another (maybe more than one) script(s)? The reason that I'm asking is that I'd like to do this myself for any kernel. If I use your patches, I'd have to be using 2.4.21 or 2.4.22.

Troy Henderson

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

Yes, that would. I invite you to take a look at the kernel/i2c.h file in your local i2c CVS copy to make sure you have i2c_delay() there. Then look at the patch you generated and make check that i2c_delay() is there too. Hopefully you will understand where it does go wrong.

There's no i2c_delay() in my CVS version of i2c.h either.

Quoted 2 lines

Eventually I'll make a patch available for 2.4.23-rc1 if there are enough requests for such a patch.

I was just wanting to get a "good" way to patch 2.4.23 when it comes out so that I wouldn't have to wait for your patches since I know that you're probably pretty darn busy.

Troy Henderson