linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* 2.6.25: pmac_newworld undefined
@ 2008-04-27 18:03 Christian Kujau
  2008-04-28  4:20 ` Tony Breeds
  2008-04-29  1:42 ` [PATCH] Allow builing of pmac32 when CONFIG_NVRAM=m Tony Breeds
  0 siblings, 2 replies; 7+ messages in thread
From: Christian Kujau @ 2008-04-27 18:03 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: LKML

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
-- 
BOFH excuse #187:

Reformatting Page. Wait...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.6.25: pmac_newworld undefined
  2008-04-27 18:03 2.6.25: pmac_newworld undefined Christian Kujau
@ 2008-04-28  4:20 ` Tony Breeds
  2008-04-28 19:33   ` Sam Ravnborg
  2008-04-29  1:42 ` [PATCH] Allow builing of pmac32 when CONFIG_NVRAM=m Tony Breeds
  1 sibling, 1 reply; 7+ messages in thread
From: Tony Breeds @ 2008-04-28  4:20 UTC (permalink / raw)
  To: Christian Kujau, Sam Ravnborg; +Cc: linuxppc-dev, LKML

On Sun, Apr 27, 2008 at 08:03:46PM +0200, Christian Kujau wrote:
> 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!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.6.25: pmac_newworld undefined
  2008-04-28  4:20 ` Tony Breeds
@ 2008-04-28 19:33   ` Sam Ravnborg
  2008-04-29 13:35     ` Adrian Bunk
  0 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2008-04-28 19:33 UTC (permalink / raw)
  To: Tony Breeds; +Cc: linuxppc-dev, LKML

On Mon, Apr 28, 2008 at 02:20:44PM +1000, Tony Breeds wrote:
> On Sun, Apr 27, 2008 at 08:03:46PM +0200, Christian Kujau wrote:
> > 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?

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] Allow builing of pmac32 when CONFIG_NVRAM=m
  2008-04-27 18:03 2.6.25: pmac_newworld undefined Christian Kujau
  2008-04-28  4:20 ` Tony Breeds
@ 2008-04-29  1:42 ` Tony Breeds
  1 sibling, 0 replies; 7+ messages in thread
From: Tony Breeds @ 2008-04-29  1:42 UTC (permalink / raw)
  To: Paul Mackerras, linuxppc-dev; +Cc: Kamalesh Babulal

Kamalesh Babulal (kamalesh@linux.vnet.ibm.com) 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'

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
 arch/powerpc/platforms/powermac/Makefile |    5 ++++-
 arch/powerpc/platforms/powermac/setup.c  |    3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile
index 78093d7..4d72c8f 100644
--- a/arch/powerpc/platforms/powermac/Makefile
+++ b/arch/powerpc/platforms/powermac/Makefile
@@ -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
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index bf44c54..00bd016 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -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
 
-- 
1.5.5.1

Yours Tony

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: 2.6.25: pmac_newworld undefined
  2008-04-28 19:33   ` Sam Ravnborg
@ 2008-04-29 13:35     ` Adrian Bunk
  2008-04-29 19:17       ` Sam Ravnborg
  0 siblings, 1 reply; 7+ messages in thread
From: Adrian Bunk @ 2008-04-29 13:35 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linuxppc-dev, LKML

On Mon, Apr 28, 2008 at 09:33:24PM +0200, Sam Ravnborg wrote:
> On Mon, Apr 28, 2008 at 02:20:44PM +1000, Tony Breeds wrote:
> > On Sun, Apr 27, 2008 at 08:03:46PM +0200, Christian Kujau wrote:
> > > 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?
> 
> 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.

> 	Sam

cu
Adrian

-- 

       "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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.6.25: pmac_newworld undefined
  2008-04-29 13:35     ` Adrian Bunk
@ 2008-04-29 19:17       ` Sam Ravnborg
  2008-04-29 19:45         ` Adrian Bunk
  0 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2008-04-29 19:17 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linuxppc-dev, LKML

On Tue, Apr 29, 2008 at 04:35:14PM +0300, Adrian Bunk wrote:
> On Mon, Apr 28, 2008 at 09:33:24PM +0200, Sam Ravnborg wrote:
> > On Mon, Apr 28, 2008 at 02:20:44PM +1000, Tony Breeds wrote:
> > > On Sun, Apr 27, 2008 at 08:03:46PM +0200, Christian Kujau wrote:
> > > > 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?
> > 
> > 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.

> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.6.25: pmac_newworld undefined
  2008-04-29 19:17       ` Sam Ravnborg
@ 2008-04-29 19:45         ` Adrian Bunk
  0 siblings, 0 replies; 7+ messages in thread
From: Adrian Bunk @ 2008-04-29 19:45 UTC (permalink / raw)
  To: Sam Ravnborg, paulus; +Cc: linuxppc-dev, LKML

On Tue, Apr 29, 2008 at 09:17:53PM +0200, Sam Ravnborg wrote:
>...
> 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?

> 	Sam

cu
Adrian

-- 

       "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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-29 19:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-27 18:03 2.6.25: pmac_newworld undefined Christian Kujau
2008-04-28  4:20 ` Tony Breeds
2008-04-28 19:33   ` Sam Ravnborg
2008-04-29 13:35     ` Adrian Bunk
2008-04-29 19:17       ` Sam Ravnborg
2008-04-29 19:45         ` Adrian Bunk
2008-04-29  1:42 ` [PATCH] Allow builing of pmac32 when CONFIG_NVRAM=m Tony Breeds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).