Skip to contentSkip to conversation

BLK_DEV_MD with CONFIG_NET

DISCUSSION Randy Dunlap 5 participants 6 messages Mar 21, 2007 – Mar 22, 2007 MD RAID

lore
Share & tools
lore
#0 lore raw

drivers/md/md.c calls csum_partial().

IF CONFIG_NET=n and BLK_DEV_MD=y, if arch/*/lib/Makefile puts csum-partial.o or checksum.o into lib-y, the function is present. (Of course, if the function is placed in obj-y, there is no problem.)

If CONFIG_NET=n and BLK_DEV_MD=n, if arch/*/lib/Makefile puts csum-partial.o or checksum.o into lib-y, the function is removed from the kernel image due to having no built-in callers.

Build a kernel with CONFIG_NET-n and CONFIG_BLK_DEV_MD=m. Unless csum_partial() is built and kept by some arch Makefile, the result is:
ERROR: "csum_partial" [drivers/md/md-mod.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Any suggested solutions?

Recorded for posterity here:
http://bugzilla.kernel.org/show_bug.cgi?id=8242

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#1 lore raw

From: Randy Dunlap <[email protected]>
Date: Tue, 20 Mar 2007 20:05:38 -0700

Quoted 9 lines

Build a kernel with CONFIG_NET-n and CONFIG_BLK_DEV_MD=m. Unless csum_partial() is built and kept by some arch Makefile, the result is:
ERROR: "csum_partial" [drivers/md/md-mod.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Any suggested solutions?

Anything which is every exported to modules, which ought to be the situation in this case, should be obj-y not lib-y right?

#2 lore raw
Quoted 11 lines · David Miller

From: Randy Dunlap <[email protected]>
Date: Tue, 20 Mar 2007 20:05:38 -0700

Quoted 8 lines

Build a kernel with CONFIG_NET-n and CONFIG_BLK_DEV_MD=m. Unless csum_partial() is built and kept by some arch Makefile, the result is:
ERROR: "csum_partial" [drivers/md/md-mod.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Quoted 5 lines
Quoted 1 line

Any suggested solutions?

Anything which is every exported to modules, which ought to be the situation in this case, should be obj-y not lib-y right?

That is also my understanding of lib-y - I should update makefiles.txt to reflect this..

Sam

#3 lore raw
Quoted 6 lines · On Wednesday 21 March 2007 13:02:46 Sam Ravnborg wrote:
Quoted 3 lines

Anything which is every exported to modules, which ought to be the situation in this case, should be obj-y not lib-y right?

That is also my understanding of lib-y - I should update makefiles.txt to reflect this..

Strictly speaking, it could well be obj-m instead of obj-y if it is _only_ used by modules. OTOH, it makes the Makefile a lot simpler to not optimize for this case.

	Arnd <><
#4 lore raw
Quoted 11 lines · Arnd Bergmann
Quoted 6 lines · On Wednesday 21 March 2007 13:02:46 Sam Ravnborg wrote:
Quoted 3 lines

Anything which is every exported to modules, which ought to be the situation in this case, should be obj-y not lib-y right?

That is also my understanding of lib-y - I should update makefiles.txt to reflect this..

Strictly speaking, it could well be obj-m instead of obj-y if it is _only_ used by modules. OTOH, it makes the Makefile a lot simpler to not optimize for this case.

No, it is only used by modules only if CONFIG_BLK_DEV_MD=m and CONFIG_NET=n...

And except for some legacy drivers, there shouldn't be any module-only code in the kernel.

The solution is either obj-y or obj-$(CONFIG_CSUM_PARIAL).

Quoted 1 line

Arnd

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#5 lore raw
In reply to Sam Ravnborg
Quoted 12 lines · On Wed, 21 Mar 2007 13:02:46 +0100 Sam Ravnborg wrote:
Quoted 11 lines · David Miller

From: Randy Dunlap <[email protected]>
Date: Tue, 20 Mar 2007 20:05:38 -0700

Quoted 8 lines

Build a kernel with CONFIG_NET-n and CONFIG_BLK_DEV_MD=m. Unless csum_partial() is built and kept by some arch Makefile, the result is:
ERROR: "csum_partial" [drivers/md/md-mod.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Any suggested solutions?

Anything which is every exported to modules, which ought to be the situation in this case, should be obj-y not lib-y right?

That is also my understanding of lib-y - I should update makefiles.txt to reflect this..

I concur, but there seems to be quite a bit of change needed in Makefile*s for this. I'll begin with csum_partial() and trying to use Arnd's suggestion as well.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***