Skip to contentSkip to conversation

2.6.25: pmac_newworld undefined

PATCH New Christian Kujau 4 participants 7 messages Apr 27, 2008 – Apr 29, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

the build failure reported[0] by Kamalesh back in 01/2008 is still present in today's 2.6.25-git with CONFIG_NVRAM=m (instead of =y):

Building modules, stage 2.
MODPOST 72 modules
ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] undefined! make[1]: *** [__modpost] Error 1

Full .config and make.log: http://nerdbynature.de/bits/2.6.25/nvram/

I could not find an #ifdef or sth. around pmac_newworld....

Thanks,
Christian.

[0] http://lkml.org/lkml/2008/1/17/55

Signature · 3 lines
BOFH excuse #187:

Reformatting Page. Wait...
#1 lore raw
Quoted 11 lines · Christian Kujau

Hi,

the build failure reported[0] by Kamalesh back in 01/2008 is still present in today's 2.6.25-git with CONFIG_NVRAM=m (instead of =y):

Building modules, stage 2.
MODPOST 72 modules
ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
make[1]: *** [__modpost] Error 1

Yeah that isn't really surprising. Essentially arch/powerpc/platforms/powermac/nvram.c must be builtin (not modular) but CONFIG_NVRAM is tristate, and your .config has CONFIG_NVRAM=m.

We can probably "fix" this by adding another config config symbol and "selecting" that from CONFIG_NVRAM. Then using this new symbol in arch/powerpc/platforms/powermac/*

so I think with we need is:
config NVRAM
bool "..." if PPC32
tristate "..." if !PPC32
...
...

Sam is there some way to achieve that or should we just create an secondary symbol?

Yours Tony

linux.conf.au http://www.marchsouth.org/
Jan 19 - 24 2009 The Australian Linux Technical Conference!

#2 lore raw
Quoted 28 lines · Tony Breeds
Quoted 11 lines · Christian Kujau

Hi,

the build failure reported[0] by Kamalesh back in 01/2008 is still present in today's 2.6.25-git with CONFIG_NVRAM=m (instead of =y):

Building modules, stage 2.
MODPOST 72 modules
ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
make[1]: *** [__modpost] Error 1

Yeah that isn't really surprising. Essentially arch/powerpc/platforms/powermac/nvram.c must be builtin (not modular) but CONFIG_NVRAM is tristate, and your .config has CONFIG_NVRAM=m.

We can probably "fix" this by adding another config config symbol and "selecting" that from CONFIG_NVRAM. Then using this new symbol in arch/powerpc/platforms/powermac/*

so I think with we need is:
config NVRAM
bool "..." if PPC32
tristate "..." if !PPC32
...
...

Quoted 2 lines

Sam is there some way to achieve that or should we just create an secondary symbol?

In the Makefile you could just do a:

obj-$(CONFIG_NVRAM:m=y) += nvram.o

Then you would force nvram to be build-in.
That looks simpler than messing with Kconfig in this case.

Sam

#3 lore raw
Quoted 32 lines · Sam Ravnborg
Quoted 28 lines · Tony Breeds
Quoted 11 lines · Christian Kujau

Hi,

the build failure reported[0] by Kamalesh back in 01/2008 is still present in today's 2.6.25-git with CONFIG_NVRAM=m (instead of =y):

Building modules, stage 2.
MODPOST 72 modules
ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
make[1]: *** [__modpost] Error 1

Yeah that isn't really surprising. Essentially arch/powerpc/platforms/powermac/nvram.c must be builtin (not modular) but CONFIG_NVRAM is tristate, and your .config has CONFIG_NVRAM=m.

We can probably "fix" this by adding another config config symbol and "selecting" that from CONFIG_NVRAM. Then using this new symbol in arch/powerpc/platforms/powermac/*

so I think with we need is:
config NVRAM
bool "..." if PPC32
tristate "..." if !PPC32
...
...

Quoted 2 lines

Sam is there some way to achieve that or should we just create an secondary symbol?

Quoted 6 lines

In the Makefile you could just do a:

obj-$(CONFIG_NVRAM:m=y) += nvram.o

Then you would force nvram to be build-in.
That looks simpler than messing with Kconfig in this case.

You miss that this is only true on powerpc.

And for such issues Kconfig anyway is the right place - assume how your solution would break if NVRAM would some day select or depend on some helper code.

Quoted 1 line

Sam

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
#4 lore raw
Quoted 33 lines · Adrian Bunk
Quoted 32 lines · Sam Ravnborg
Quoted 30 lines · Tony Breeds
Quoted 11 lines · Christian Kujau

Hi,

the build failure reported[0] by Kamalesh back in 01/2008 is still present in today's 2.6.25-git with CONFIG_NVRAM=m (instead of =y):

Building modules, stage 2.
MODPOST 72 modules
ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
make[1]: *** [__modpost] Error 1

Yeah that isn't really surprising. Essentially arch/powerpc/platforms/powermac/nvram.c must be builtin (not modular) but CONFIG_NVRAM is tristate, and your .config has CONFIG_NVRAM=m.

We can probably "fix" this by adding another config config symbol and "selecting" that from CONFIG_NVRAM. Then using this new symbol in arch/powerpc/platforms/powermac/*

so I think with we need is:
config NVRAM
bool "..." if PPC32
tristate "..." if !PPC32
...
...

Sam is there some way to achieve that or should we just create an secondary symbol?

Quoted 8 lines
Quoted 6 lines

In the Makefile you could just do a:

obj-$(CONFIG_NVRAM:m=y) += nvram.o

Then you would force nvram to be build-in.
That looks simpler than messing with Kconfig in this case.

You miss that this is only true on powerpc.

And so is the Makefile - right?
Or is this only true for 32 bit powerpc - in that case it is the wrong fix.

Quoted 3 lines

And for such issues Kconfig anyway is the right place - assume how your solution would break if NVRAM would some day select or depend on some helper code.

So something like:

config PPC32_NVRAM
bool
depends on NVRAM

obj-$(CONFIG_PPC32_NVRAM) += nvram.o
obj-$(CONFIG_NVRAM) += nvram.o

Or did you have another solution in mind?

Sam

#5 lore raw
Quoted 11 lines · Sam Ravnborg

...
So something like:

config PPC32_NVRAM
bool
depends on NVRAM

obj-$(CONFIG_PPC32_NVRAM) += nvram.o
obj-$(CONFIG_NVRAM) += nvram.o

Or did you have another solution in mind?

I start to understand the problem, and I'm currently wondering why powerpc uses CONFIG_NVRAM although the code CONFIG_NVRAM enables on other platforms is not enabled on powerpc.

Can we rename it and move drivers/char/generic_nvram.c under arch/powerpc/ ?

Can some powerpc person bring some background what's going on and why it's this way?

Quoted 1 line

Sam

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
#6 lore raw

PATCH 1/1 Allow builing of pmac32 when CONFIG_NVRAM=m

In reply to Christian Kujau

Kamalesh Babulal ([email protected]) reports that CONFIG_NVRAM=m is valid in terms of Kconfig but fails to build with:
Building modules, stage 2.
MODPOST 1401 modules
ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] undefined! make[1]: *** [__modpost] Error

The arch/powerpc/platforms/powermac/nvram.c code really needs to be builtin, but as it's compilation is dependant on a generic Kconfig symbol we force nvram.c to be builtin if CONFIG_NVRAM is 'y' or 'm'

---
 arch/powerpc/platforms/powermac/Makefile |    5 ++++-
 arch/powerpc/platforms/powermac/setup.c  |    3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powermac/Makefile +4 -1
index 78093d7..4d72c8f 100644
@@ -6,7 +6,10 @@ obj-y				+= pic.o setup.o time.o feature.o pci.o \
 obj-$(CONFIG_PMAC_BACKLIGHT)	+= backlight.o
 obj-$(CONFIG_CPU_FREQ_PMAC)	+= cpufreq_32.o
 obj-$(CONFIG_CPU_FREQ_PMAC64)	+= cpufreq_64.o
-obj-$(CONFIG_NVRAM)		+= nvram.o
+# CONFIG_NVRAM is an arch. independant tristate symbol, for pmac32 we really
+# need this to be a bool.  Cheat here and pretend CONFIG_NVRAM=m is really
+# CONFIG_NVRAM=y
+obj-$(CONFIG_NVRAM:m=y)		+= nvram.o
 # ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff
 obj-$(CONFIG_PPC64)		+= nvram.o
 obj-$(CONFIG_PPC32)		+= bootx_init.o
arch/powerpc/platforms/powermac/setup.c +2 -1
index bf44c54..00bd016 100644
@@ -337,7 +337,8 @@ static void __init pmac_setup_arch(void)
 	find_via_pmu();
 	smu_init();
 
-#if defined(CONFIG_NVRAM) || defined(CONFIG_PPC64)
+#if defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) || \
+    defined(CONFIG_PPC64)
 	pmac_nvram_init();
 #endif
 
Signature · 6 lines
1.5.5.1

Yours Tony

  linux.conf.au    http://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!