LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   SL10 kernel module compile errors (https://www.linuxquestions.org/questions/suse-opensuse-60/sl10-kernel-module-compile-errors-380178/)

jcart 11-05-2005 08:18 AM

SL10 kernel module compile errors
 
Jan:
As you know I have been developing & shipping SATA with RAID drivers for linux (uses scsi_mod), but still feel I am a kernel newbie. Below is a code snippet. On SLES 9 (kernel 2.6.5 and older including 2.4) the driver works great. But on SL10 (2.6.13) the code snippet below causes the compiler to generate a call to memcpy(). Using NLKD I can step thru the code. I see that the compiler is pushing all three args on the stack, but memcpy() is expecting some of the args in regs. On SLES 9 (2.6.5) the compiler generates the code inline and it works.
On SL10 I changed my make file to use -O2 which causes this code to be inlined, but now my driver just goes off into never never land somewhere, no crash, kernel just hangs.
Any suggestions? Where should I post this?

PCHAR modes[] = {"pio-0", "pio-1", "pio-2", "pio-3","pio-4", "mdma-0", "mdma-1","mdma-2", "udma-0", "udma-1","udma-2", "udma-3", "udma-4","udma-5"};

Thanks
Joe

jcart 11-08-2005 09:22 AM

Joe,

This sounds like an inconsistent build environment * are you making
sure you use the normal kbuild environment to build the module? The
compiler must be run with consistent settings (in this case -mregparm=3
due to CONFIG_REGPARM). Unless gcc 4.0.x has a bug where it doesn't
honor this when calling expansions for builtins. You'd need to verify
the command line options stored in the .*.o.cmd files to determine what
happens.

As to the hang when using -O2 (you having to use this makes me very
suspicious regarding the above mentioned consistency needs), I don't
think you can reasonably report anything before finding out what causes
the hang (and where). But maybe this goes away when the above gets
addressed...

Jan
Having -mregparm=3 in all three makefiles of the driver solved the problem.


All times are GMT -5. The time now is 05:57 AM.