All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/5] Move gcmp_probe to before the SMP ops
@ 2009-06-17 23:25 Tim Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Anderson @ 2009-06-17 23:25 UTC (permalink / raw)
  To: linux-mips

This is to move the gcmp_probe call to before the
use of and selection of the smp_ops functions. This
allows malta with 1004K to work. Revised for
readability and checkpatch.

Signed-off-by: Tim Anderson <tanderson@mvista.com>
---
 arch/mips/include/asm/gcmpregs.h |    2 ++
 arch/mips/mti-malta/malta-init.c |   14 +++++++++++++-
 arch/mips/mti-malta/malta-int.c  |    5 +----
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/gcmpregs.h b/arch/mips/include/asm/gcmpregs.h
index d74a8a4..36fd969 100644
--- a/arch/mips/include/asm/gcmpregs.h
+++ b/arch/mips/include/asm/gcmpregs.h
@@ -114,4 +114,6 @@
 #define GCMP_CCB_DINTGROUP_OFS		0x0030		/* DINT Group Participate */
 #define GCMP_CCB_DBGGROUP_OFS		0x0100		/* DebugBreak Group */
 
+extern int __init gcmp_probe(unsigned long, unsigned long);
+
 #endif /* _ASM_GCMPREGS_H */
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index 475038a..27c807b 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -30,6 +30,7 @@
 #include <asm/cacheflush.h>
 #include <asm/traps.h>
 
+#include <asm/gcmpregs.h>
 #include <asm/mips-boards/prom.h>
 #include <asm/mips-boards/generic.h>
 #include <asm/mips-boards/bonito64.h>
@@ -192,6 +193,8 @@ extern struct plat_smp_ops msmtc_smp_ops;
 
 void __init prom_init(void)
 {
+	int result;
+
 	prom_argc = fw_arg0;
 	_prom_argv = (int *) fw_arg1;
 	_prom_envp = (int *) fw_arg2;
@@ -358,12 +361,21 @@ void __init prom_init(void)
 #ifdef CONFIG_SERIAL_8250_CONSOLE
 	console_config();
 #endif
+	/* Early detection of CMP support */
+	result = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
+
 #ifdef CONFIG_MIPS_CMP
-	register_smp_ops(&cmp_smp_ops);
+	if (result)
+		register_smp_ops(&cmp_smp_ops);
 #endif
 #ifdef CONFIG_MIPS_MT_SMP
+#ifdef CONFIG_MIPS_CMP
+	if (!result)
+		register_smp_ops(&vsmp_smp_ops);
+#else
 	register_smp_ops(&vsmp_smp_ops);
 #endif
+#endif
 #ifdef CONFIG_MIPS_MT_SMTC
 	register_smp_ops(&msmtc_smp_ops);
 #endif
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index 44b23bf..107fb34 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -408,7 +408,7 @@ static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
 /*
  * GCMP needs to be detected before any SMP initialisation
  */
-static int __init gcmp_probe(unsigned long addr, unsigned long size)
+int __init gcmp_probe(unsigned long addr, unsigned long size)
 {
 	if (gcmp_present >= 0)
 		return gcmp_present;
@@ -448,14 +448,11 @@ static void __init fill_ipi_map(void)
 
 void __init arch_init_irq(void)
 {
-	int gic_present, gcmp_present;
-
 	init_i8259_irqs();
 
 	if (!cpu_has_veic)
 		mips_cpu_irq_init();
 
-	gcmp_present = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
 	if (gcmp_present)  {
 		GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK;
 		gic_present = 1;
-- 
1.6.2.5.175.g7c84

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

* RE: [PATCH 4/5] Move gcmp_probe to before the SMP ops
@ 2009-06-17 15:40     ` Tim Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Anderson @ 2009-06-17 15:40 UTC (permalink / raw)
  To: 'Ralf Baechle'; +Cc: linux-mips

 

> -----Original Message-----
> From: Ralf Baechle [mailto:ralf@linux-mips.org] 
> Sent: Wednesday, June 17, 2009 1:21 AM
> To: Tim Anderson
> Cc: linux-mips@linux-mips.org
> Subject: Re: [PATCH 4/5] Move gcmp_probe to before the SMP ops
> 
> On Tue, Jun 16, 2009 at 05:00:35PM -0700, Tim Anderson wrote:
> 
> > @@ -358,10 +361,16 @@ void __init prom_init(void)
> >  #ifdef CONFIG_SERIAL_8250_CONSOLE
> >  	console_config();
> >  #endif
> > +	/* Early detection of CMP support */
> > +	result = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
> > +
> >  #ifdef CONFIG_MIPS_CMP
> > -	register_smp_ops(&cmp_smp_ops);
> > +	if (result) register_smp_ops(&cmp_smp_ops);
> 
> Keep the register_smp_ops on a separate line.
> 
> >  #endif
> >  #ifdef CONFIG_MIPS_MT_SMP
> > +#ifdef CONFIG_MIPS_CMP
> > +	if (!result)
> > +#endif
> >  	register_smp_ops(&vsmp_smp_ops);
> 
> Suggested rewrite for readability and to silence checkpatch:
> 
> #ifdef CONFIG_MIPS_CMP
> 	if (!result)
> 		register_smp_ops(&vsmp_smp_ops);
> #else
> 	register_smp_ops(&vsmp_smp_ops);
> #endif
> 
>   Ralf

Yes that may be better to understand.

I will re-submit.

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

* RE: [PATCH 4/5] Move gcmp_probe to before the SMP ops
@ 2009-06-17 15:40     ` Tim Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Anderson @ 2009-06-17 15:40 UTC (permalink / raw)
  To: 'Ralf Baechle'; +Cc: linux-mips

 

> -----Original Message-----
> From: Ralf Baechle [mailto:ralf@linux-mips.org] 
> Sent: Wednesday, June 17, 2009 1:21 AM
> To: Tim Anderson
> Cc: linux-mips@linux-mips.org
> Subject: Re: [PATCH 4/5] Move gcmp_probe to before the SMP ops
> 
> On Tue, Jun 16, 2009 at 05:00:35PM -0700, Tim Anderson wrote:
> 
> > @@ -358,10 +361,16 @@ void __init prom_init(void)
> >  #ifdef CONFIG_SERIAL_8250_CONSOLE
> >  	console_config();
> >  #endif
> > +	/* Early detection of CMP support */
> > +	result = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
> > +
> >  #ifdef CONFIG_MIPS_CMP
> > -	register_smp_ops(&cmp_smp_ops);
> > +	if (result) register_smp_ops(&cmp_smp_ops);
> 
> Keep the register_smp_ops on a separate line.
> 
> >  #endif
> >  #ifdef CONFIG_MIPS_MT_SMP
> > +#ifdef CONFIG_MIPS_CMP
> > +	if (!result)
> > +#endif
> >  	register_smp_ops(&vsmp_smp_ops);
> 
> Suggested rewrite for readability and to silence checkpatch:
> 
> #ifdef CONFIG_MIPS_CMP
> 	if (!result)
> 		register_smp_ops(&vsmp_smp_ops);
> #else
> 	register_smp_ops(&vsmp_smp_ops);
> #endif
> 
>   Ralf

Yes that may be better to understand.

I will re-submit.

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

* Re: [PATCH 4/5] Move gcmp_probe to before the SMP ops
  2009-06-17  0:00 Tim Anderson
@ 2009-06-17  8:21 ` Ralf Baechle
  2009-06-17 15:40     ` Tim Anderson
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Baechle @ 2009-06-17  8:21 UTC (permalink / raw)
  To: Tim Anderson; +Cc: linux-mips

On Tue, Jun 16, 2009 at 05:00:35PM -0700, Tim Anderson wrote:

> @@ -358,10 +361,16 @@ void __init prom_init(void)
>  #ifdef CONFIG_SERIAL_8250_CONSOLE
>  	console_config();
>  #endif
> +	/* Early detection of CMP support */
> +	result = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
> +
>  #ifdef CONFIG_MIPS_CMP
> -	register_smp_ops(&cmp_smp_ops);
> +	if (result) register_smp_ops(&cmp_smp_ops);

Keep the register_smp_ops on a separate line.

>  #endif
>  #ifdef CONFIG_MIPS_MT_SMP
> +#ifdef CONFIG_MIPS_CMP
> +	if (!result)
> +#endif
>  	register_smp_ops(&vsmp_smp_ops);

Suggested rewrite for readability and to silence checkpatch:

#ifdef CONFIG_MIPS_CMP
	if (!result)
		register_smp_ops(&vsmp_smp_ops);
#else
	register_smp_ops(&vsmp_smp_ops);
#endif

  Ralf

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

* [PATCH 4/5] Move gcmp_probe to before the SMP ops
@ 2009-06-17  0:00 Tim Anderson
  2009-06-17  8:21 ` Ralf Baechle
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Anderson @ 2009-06-17  0:00 UTC (permalink / raw)
  To: linux-mips

This is to move the gcmp_probe call to before the
use of and selection of the smp_ops functions. This
allows malta with 1004K to work.

Signed-off-by: Tim Anderson <tanderson@mvista.com>
---
 arch/mips/include/asm/gcmpregs.h |    2 ++
 arch/mips/mti-malta/malta-init.c |   11 ++++++++++-
 arch/mips/mti-malta/malta-int.c  |    5 +----
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/gcmpregs.h b/arch/mips/include/asm/gcmpregs.h
index d74a8a4..36fd969 100644
--- a/arch/mips/include/asm/gcmpregs.h
+++ b/arch/mips/include/asm/gcmpregs.h
@@ -114,4 +114,6 @@
 #define GCMP_CCB_DINTGROUP_OFS		0x0030		/* DINT Group Participate */
 #define GCMP_CCB_DBGGROUP_OFS		0x0100		/* DebugBreak Group */
 
+extern int __init gcmp_probe(unsigned long, unsigned long);
+
 #endif /* _ASM_GCMPREGS_H */
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index 475038a..e988e33 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -30,6 +30,7 @@
 #include <asm/cacheflush.h>
 #include <asm/traps.h>
 
+#include <asm/gcmpregs.h>
 #include <asm/mips-boards/prom.h>
 #include <asm/mips-boards/generic.h>
 #include <asm/mips-boards/bonito64.h>
@@ -192,6 +193,8 @@ extern struct plat_smp_ops msmtc_smp_ops;
 
 void __init prom_init(void)
 {
+	int result;
+
 	prom_argc = fw_arg0;
 	_prom_argv = (int *) fw_arg1;
 	_prom_envp = (int *) fw_arg2;
@@ -358,10 +361,16 @@ void __init prom_init(void)
 #ifdef CONFIG_SERIAL_8250_CONSOLE
 	console_config();
 #endif
+	/* Early detection of CMP support */
+	result = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
+
 #ifdef CONFIG_MIPS_CMP
-	register_smp_ops(&cmp_smp_ops);
+	if (result) register_smp_ops(&cmp_smp_ops);
 #endif
 #ifdef CONFIG_MIPS_MT_SMP
+#ifdef CONFIG_MIPS_CMP
+	if (!result)
+#endif
 	register_smp_ops(&vsmp_smp_ops);
 #endif
 #ifdef CONFIG_MIPS_MT_SMTC
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index 44b23bf..107fb34 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -408,7 +408,7 @@ static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
 /*
  * GCMP needs to be detected before any SMP initialisation
  */
-static int __init gcmp_probe(unsigned long addr, unsigned long size)
+int __init gcmp_probe(unsigned long addr, unsigned long size)
 {
 	if (gcmp_present >= 0)
 		return gcmp_present;
@@ -448,14 +448,11 @@ static void __init fill_ipi_map(void)
 
 void __init arch_init_irq(void)
 {
-	int gic_present, gcmp_present;
-
 	init_i8259_irqs();
 
 	if (!cpu_has_veic)
 		mips_cpu_irq_init();
 
-	gcmp_present = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
 	if (gcmp_present)  {
 		GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK;
 		gic_present = 1;
-- 
1.6.2.5.170.gf2181

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

end of thread, other threads:[~2009-06-17 23:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 23:25 [PATCH 4/5] Move gcmp_probe to before the SMP ops Tim Anderson
  -- strict thread matches above, loose matches on Subject: below --
2009-06-17  0:00 Tim Anderson
2009-06-17  8:21 ` Ralf Baechle
2009-06-17 15:40   ` Tim Anderson
2009-06-17 15:40     ` Tim Anderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.