linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2
@ 2012-09-30 23:22 Jason Gunthorpe
  2012-10-01  2:44 ` Olof Johansson
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Gunthorpe @ 2012-09-30 23:22 UTC (permalink / raw)
  To: linux-arm-kernel

Move the CACHE_FEROCEON_L2 test to kirkwood_l2_init, since linking
fails on the reference to feroceon_l2_init.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 arch/arm/mach-kirkwood/board-dt.c |    2 --
 arch/arm/mach-kirkwood/common.c   |    4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index e4eb450..d00223e 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -50,9 +50,7 @@ static void __init kirkwood_dt_init(void)
 
 	kirkwood_setup_cpu_mbus();
 
-#ifdef CONFIG_CACHE_FEROCEON_L2
 	kirkwood_l2_init();
-#endif
 
 	/* Setup root of clk tree */
 	kirkwood_clk_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 1201191..4177304 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -645,6 +645,7 @@ char * __init kirkwood_id(void)
 
 void __init kirkwood_l2_init(void)
 {
+#ifdef CONFIG_CACHE_FEROCEON_L2
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
 	feroceon_l2_init(1);
@@ -652,6 +653,7 @@ void __init kirkwood_l2_init(void)
 	writel(readl(L2_CONFIG_REG) & ~L2_WRITETHROUGH, L2_CONFIG_REG);
 	feroceon_l2_init(0);
 #endif
+#endif
 }
 
 void __init kirkwood_init(void)
@@ -669,9 +671,7 @@ void __init kirkwood_init(void)
 
 	kirkwood_setup_cpu_mbus();
 
-#ifdef CONFIG_CACHE_FEROCEON_L2
 	kirkwood_l2_init();
-#endif
 
 	/* Setup root of clk tree */
 	kirkwood_clk_init();
-- 
1.7.4.1

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

* [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2
  2012-09-30 23:22 [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2 Jason Gunthorpe
@ 2012-10-01  2:44 ` Olof Johansson
  2012-10-01  4:43   ` Jason Gunthorpe
  2012-10-01 10:46   ` Jason Cooper
  0 siblings, 2 replies; 7+ messages in thread
From: Olof Johansson @ 2012-10-01  2:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sun, Sep 30, 2012 at 4:22 PM, Jason Gunthorpe
<jgunthorpe@obsidianresearch.com> wrote:
> Move the CACHE_FEROCEON_L2 test to kirkwood_l2_init, since linking
> fails on the reference to feroceon_l2_init.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
>  arch/arm/mach-kirkwood/board-dt.c |    2 --
>  arch/arm/mach-kirkwood/common.c   |    4 ++--
>  2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index e4eb450..d00223e 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -50,9 +50,7 @@ static void __init kirkwood_dt_init(void)
>
>         kirkwood_setup_cpu_mbus();
>
> -#ifdef CONFIG_CACHE_FEROCEON_L2
>         kirkwood_l2_init();
> -#endif
>
>         /* Setup root of clk tree */
>         kirkwood_clk_init();
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index 1201191..4177304 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -645,6 +645,7 @@ char * __init kirkwood_id(void)
>
>  void __init kirkwood_l2_init(void)
>  {
> +#ifdef CONFIG_CACHE_FEROCEON_L2
>  #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH

Aren't these added ifdefs completely redundant? L2_WRITETHROUGH is
dependent on the outer options anyway.


-Olof

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

* [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2
  2012-10-01  2:44 ` Olof Johansson
@ 2012-10-01  4:43   ` Jason Gunthorpe
  2012-10-01 14:31     ` Olof Johansson
  2012-10-01 10:46   ` Jason Cooper
  1 sibling, 1 reply; 7+ messages in thread
From: Jason Gunthorpe @ 2012-10-01  4:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Sep 30, 2012 at 07:44:10PM -0700, Olof Johansson wrote:

> >  void __init kirkwood_l2_init(void)
> >  {
> > +#ifdef CONFIG_CACHE_FEROCEON_L2
> >  #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
> 
> Aren't these added ifdefs completely redundant? L2_WRITETHROUGH is
> dependent on the outer options anyway.

No, the complete new function is:

void __init kirkwood_l2_init(void)
{
#ifdef CONFIG_CACHE_FEROCEON_L2
#ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
        writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
        feroceon_l2_init(1);
#else
        writel(readl(L2_CONFIG_REG) & ~L2_WRITETHROUGH, L2_CONFIG_REG);
        feroceon_l2_init(0);
#endif
#endif
}

So you hit the #else clause and link fails on feroceon_l2_init because
of:

obj-$(CONFIG_CACHE_FEROCEON_L2) += cache-feroceon-l2.o

Jason

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

* [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2
  2012-10-01  2:44 ` Olof Johansson
  2012-10-01  4:43   ` Jason Gunthorpe
@ 2012-10-01 10:46   ` Jason Cooper
  1 sibling, 0 replies; 7+ messages in thread
From: Jason Cooper @ 2012-10-01 10:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Sep 30, 2012 at 07:44:10PM -0700, Olof Johansson wrote:
> Hi,
> 
> On Sun, Sep 30, 2012 at 4:22 PM, Jason Gunthorpe
> <jgunthorpe@obsidianresearch.com> wrote:
> > Move the CACHE_FEROCEON_L2 test to kirkwood_l2_init, since linking
> > fails on the reference to feroceon_l2_init.
> >
> > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> > ---
> >  arch/arm/mach-kirkwood/board-dt.c |    2 --
> >  arch/arm/mach-kirkwood/common.c   |    4 ++--
> >  2 files changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> > index e4eb450..d00223e 100644
> > --- a/arch/arm/mach-kirkwood/board-dt.c
> > +++ b/arch/arm/mach-kirkwood/board-dt.c
> > @@ -50,9 +50,7 @@ static void __init kirkwood_dt_init(void)
> >
> >         kirkwood_setup_cpu_mbus();
> >
> > -#ifdef CONFIG_CACHE_FEROCEON_L2
> >         kirkwood_l2_init();
> > -#endif
> >
> >         /* Setup root of clk tree */
> >         kirkwood_clk_init();
> > diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> > index 1201191..4177304 100644
> > --- a/arch/arm/mach-kirkwood/common.c
> > +++ b/arch/arm/mach-kirkwood/common.c
> > @@ -645,6 +645,7 @@ char * __init kirkwood_id(void)
> >
> >  void __init kirkwood_l2_init(void)
> >  {
> > +#ifdef CONFIG_CACHE_FEROCEON_L2
> >  #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
> 
> Aren't these added ifdefs completely redundant? L2_WRITETHROUGH is
> dependent on the outer options anyway.

I thought so as well, so I went and looked at the code.  There is a
#else between the original #ifdef/#endif pair.  So, feroceon_l2_init()
gets called in both cases.

hth,

Jason.

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

* [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2
  2012-10-01  4:43   ` Jason Gunthorpe
@ 2012-10-01 14:31     ` Olof Johansson
  2012-10-02 17:50       ` Jason Gunthorpe
  0 siblings, 1 reply; 7+ messages in thread
From: Olof Johansson @ 2012-10-01 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Sep 30, 2012 at 9:43 PM, Jason Gunthorpe
<jgunthorpe@obsidianresearch.com> wrote:
> On Sun, Sep 30, 2012 at 07:44:10PM -0700, Olof Johansson wrote:
>
>> >  void __init kirkwood_l2_init(void)
>> >  {
>> > +#ifdef CONFIG_CACHE_FEROCEON_L2
>> >  #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
>>
>> Aren't these added ifdefs completely redundant? L2_WRITETHROUGH is
>> dependent on the outer options anyway.
>
> No, the complete new function is:
>
> void __init kirkwood_l2_init(void)
> {
> #ifdef CONFIG_CACHE_FEROCEON_L2
> #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
>         writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
>         feroceon_l2_init(1);
> #else
>         writel(readl(L2_CONFIG_REG) & ~L2_WRITETHROUGH, L2_CONFIG_REG);
>         feroceon_l2_init(0);
> #endif
> #endif
> }

Ah. diff took out the #else in the middle and I didn't look at the
file. Obviously correct as-is.

In some other places we choose to put the ifdef outside the function
and provide a static inline stub in the header file instead. Either
way works fine though.


-Olof

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

* [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2
  2012-10-01 14:31     ` Olof Johansson
@ 2012-10-02 17:50       ` Jason Gunthorpe
  2012-10-03 13:39         ` Jason Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Gunthorpe @ 2012-10-02 17:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 01, 2012 at 07:31:58AM -0700, Olof Johansson wrote:

> Ah. diff took out the #else in the middle and I didn't look at the
> file. Obviously correct as-is.
> 
> In some other places we choose to put the ifdef outside the function
> and provide a static inline stub in the header file instead. Either
> way works fine though.

I don't actually expect anyone will run CONFIG_ARCH_KIRKWOOD_DT
without CACHE_FEROCEON_L2 - I had thought about just forcing kconfig
to include CACHE_FEROCEON_L2, but figured there was some reason they
were separate.. 

Is there anything further I should do to get this patch upstream?

Thanks,
Jason

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

* [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2
  2012-10-02 17:50       ` Jason Gunthorpe
@ 2012-10-03 13:39         ` Jason Cooper
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Cooper @ 2012-10-03 13:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 02, 2012 at 11:50:02AM -0600, Jason Gunthorpe wrote:
> On Mon, Oct 01, 2012 at 07:31:58AM -0700, Olof Johansson wrote:
> 
> > Ah. diff took out the #else in the middle and I didn't look at the
> > file. Obviously correct as-is.
> > 
> > In some other places we choose to put the ifdef outside the function
> > and provide a static inline stub in the header file instead. Either
> > way works fine though.
> 
> I don't actually expect anyone will run CONFIG_ARCH_KIRKWOOD_DT
> without CACHE_FEROCEON_L2 - I had thought about just forcing kconfig
> to include CACHE_FEROCEON_L2, but figured there was some reason they
> were separate.. 
> 
> Is there anything further I should do to get this patch upstream?

nope, it's in the queue.

thx,

Jason.

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

end of thread, other threads:[~2012-10-03 13:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-30 23:22 [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2 Jason Gunthorpe
2012-10-01  2:44 ` Olof Johansson
2012-10-01  4:43   ` Jason Gunthorpe
2012-10-01 14:31     ` Olof Johansson
2012-10-02 17:50       ` Jason Gunthorpe
2012-10-03 13:39         ` Jason Cooper
2012-10-01 10:46   ` Jason Cooper

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).