RE: SMP environment driver building issue ...

WANG,YIDING (yiding_wang@am.exch.hp.com)
Mon, 20 Sep 1999 15:16:07 -0600


Rui,

Folllowed your suggestion, I run 'make config' and enable SMP support with
all other option as default value. The I run 'make dep'.

After system is reconfigured, compileing driver seems OK. However, when I
load driver "hpfc" with :
'insmod hpfc',
system still complains:
./hpfc: kernel was compiled for kernel version 2.2.5-15
while this kernel is version 2.2.5-15smp

Seems like I still miss something during the driver compiling or kernel
reconfigure. I am using "-D__SMP__" in CFLAG during the driver compiling.

Any suggestion from there to help driver successfully compiles and loads on
SMP environment?

Many thanks!

-eddie

-----Original Message-----
From: Rui Sousa [mailto:rsousa@grad.physics.sunysb.edu]
Sent: Saturday, September 18, 1999 1:26 AM
To: WANG,YIDING (HP-SanJose,ex1)
Cc: linux-kernel
Subject: Re: SMP environment driver building issue ...

"WANG,YIDING (HP-SanJose,ex1)" wrote:
>
> I have loaded RH6.0 to Dell PowerEdge2300 with 2 CPUs. My driver is
> compiled under UP system. When running 'insmod hpfc', Linux complains
that
> the driver module is not for SMP system.
>
> So I recompiled driver in this SMP system with CFLAG including "__SMP__".
> The driver cannot be comiled due to following errors:
>
> gcc -c -g -O -D__SMP__ -D__KERNEL__ -DMODULE -DFCLayer_TachyonTL -I../h
> -I../common/h -I/usr/src/linux/include hpfc.c
> /usr/src/linux/include/asm/smp.h: In function `hard_smp_processor_id':
> In file included from /usr/src/linux/include/linux/smp.h:11,
> from /usr/src/linux/include/linux/sched.h:20,
> from /usr/src/linux/include/linux/blkdev.h:5,
> from /usr/src/linux/include/linux/blk.h:4,
> from hpfc.c:81:
> /usr/src/linux/include/asm/smp.h:209: `APIC_BASE' undeclared (first use in
> this function)
> /usr/src/linux/include/asm/smp.h:209: (Each undeclared identifier is
> reported only once
> /usr/src/linux/include/asm/smp.h:209: for each function it appears in.)
> /usr/src/linux/include/asm/smp.h:209: `APIC_ID' undeclared (first use in
> this function)
> hpfc.c: In function `hpfc_DetectHBA':
> hpfc.c:615: warning: passing arg 2 of `request_irq' from incompatible
> pointer type
> hpfc.c: At top level:
> hpfc.c:2259: warning: initialization from incompatible pointer type
> hpfc.c:2259: warning: initialization from incompatible pointer type
> hpfc.c:2259: warning: initialization from incompatible pointer type
> hpfc.c:2259: warning: initialization from incompatible pointer type
> hpfc.c:2259: warning: initialization from incompatible pointer type
> hpfc.c:2259: warning: initialization from incompatible pointer type
> make: *** [hpfc.o] Error 1
>
> Could anyone help me on this issue please!
> 1, To compile a driver with SMP enabled, what flag should be defined?
> 2. What else do I need to make driver compiled for SMP?
>
> Many thanks!
>
> -eddie
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/

Hi,

Configure you kernel source for SMP (make menuconfig). Then run "make dep".
This should be enough.
Some of the kernel source headers file are modified according to the
configuration,
so if you never compiled a SMP kernel the source is not set right.

Rui Sousa

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/