Fix CONFIG_SMP=n build breaks
Subsystems (2)
PATCH 1/1 Fix CONFIG_SMP=n build breaks
Fix two build errors on powerpc allyesconfig + CONFIG_SMP=n:
arch/powerpc/platforms/built-in.o: In function `cpu_affinity_set':arch/powerpc/platforms/cell/spu_priv1_mmio.c:78: undefined reference to .iic_get_target_id' arch/powerpc/platforms/built-in.o: In function iic_init_IRQ':arch/powerpc/platforms/cell/interrupt.c:397: undefined reference to `.iic_setup_cpu'
arch/powerpc/platforms/cell/interrupt.c +5 -5
@@ -158,6 +158,11 @@ static unsigned int iic_get_irq(void)return virq; } +void iic_setup_cpu (void ) +{ +out_be64 (&__get_cpu_var (iic).regs->prio,0xff ); +} +#ifdef CONFIG_SMP /* Use the highest interrupt priorities for IPI */
@@ -166,11 +171,6 @@ static inline int iic_ipi_to_irq(int ipi)return IIC_IRQ_TYPE_IPI +0xf - ipi; } -void iic_setup_cpu (void ) -{ -out_be64 (&__get_cpu_var (iic).regs->prio,0xff ); -} -void iic_cause_IPI (int cpu,int mesg) {out_be64 (&per_cpu (iic, cpu).regs->generate, (0xf - mesg) <<4 );
arch/powerpc/platforms/cell/spu_priv1_mmio.c +2 -0
@@ -75,9 +75,11 @@ static u64 int_stat_get(struct spu *spu, int class)static void cpu_affinity_set (struct spu *spu,int cpu) { +#ifdef CONFIG_SMP u64 target =iic_get_target_id (cpu);u64 route = target <<48 | target <<32 | target <<16 ;out_be64 (&spu->priv1->int_route_RW, route); +#endif }static u64 mfc_dar_get (struct spu *spu)
Re: [PATCH] [POWERPC] Fix CONFIG_SMP=n build break
Quoted 8 lines · Olof Johansson
Fix two build errors on powerpc allyesconfig +
CONFIG_SMP=3Dn:
arch/powerpc/platforms/built-in.o: In function `cpu_affinity_set':arch/powerpc/platforms/cell/spu_priv1_mmio.c:78: undefined reference to.iic_get_target_id' arch/powerpc/platforms/built-in.o: In functioniic_init_IRQ':arch/powerpc/platforms/cell/interrupt.c:397: undefined reference to `.iic_setup_cpu'
Thanks for reporting this.
Quoted 9 lines
arch/powerpc/platforms/cell/spu_priv1_mmio.c +0
-0@@ -75,9 +75,11 @@ static u64 int_stat_get(struct spu *spu, int class)=A0
=A0static voidcpu_affinity_set(struct spu *spu, int cpu)
=A0{
+#ifdefCONFIG_SMP
=A0=A0=A0=A0=A0=A0=A0=A0u64 target =3Diic_get_target_id(cpu); =A0=A0=A0=A0=A0=A0=A0=A0u64 route =3D target << 48 | target << 32 | targe=
t << 16;
Quoted 3 lines
=A0=A0=A0=A0=A0=A0=A0=A0out_be64(&spu->priv1->int_route_RW, route); +#endif
=A0}
I think here it would be better to move iic_get_target_id out of CONFIG_SMP as well. We might want to kexec from an SMP kernel into a UP kernel, and in that case, cpu_affinity_set() should better reset the routing to CPU 0.
Arnd <><
PATCH v2 1/1 Fix CONFIG_SMP=n build break
Fix two build errors on powerpc allyesconfig + CONFIG_SMP=n:
arch/powerpc/platforms/built-in.o: In function `cpu_affinity_set':arch/powerpc/platforms/cell/spu_priv1_mmio.c:78: undefined reference to .iic_get_target_id' arch/powerpc/platforms/built-in.o: In function iic_init_IRQ':arch/powerpc/platforms/cell/interrupt.c:397: undefined reference to `.iic_setup_cpu'
---
Quoted 4 lines · Arnd Bergmann
I think here it would be better to move
iic_get_target_idout ofCONFIG_SMPas well. We might want to kexec from an SMP kernel into a UP kernel, and in that case,cpu_affinity_set()should better reset the routing to CPU 0.
Makes sense. New patch.
-Olof
arch/powerpc/platforms/cell/interrupt.c +12 -12
@@ -158,6 +158,18 @@ static unsigned int iic_get_irq(void)return virq; } +void iic_setup_cpu (void ) +{ +out_be64 (&__get_cpu_var (iic).regs->prio,0xff ); +} + +u8 iic_get_target_id (int cpu) +{ +return per_cpu (iic, cpu).target_id; +} + +EXPORT_SYMBOL_GPL (iic_get_target_id); +#ifdef CONFIG_SMP /* Use the highest interrupt priorities for IPI */
@@ -166,29 +178,17 @@ static inline int iic_ipi_to_irq(int ipi)return IIC_IRQ_TYPE_IPI +0xf - ipi; } -void iic_setup_cpu (void ) -{ -out_be64 (&__get_cpu_var (iic).regs->prio,0xff ); -} -void iic_cause_IPI (int cpu,int mesg) {out_be64 (&per_cpu (iic, cpu).regs->generate, (0xf - mesg) <<4 ); } -u8 iic_get_target_id (int cpu) -{ -return per_cpu (iic, cpu).target_id; -} -EXPORT_SYMBOL_GPL (iic_get_target_id); -struct irq_host *iic_get_irq_host (int node) {return iic_host; }EXPORT_SYMBOL_GPL (iic_get_irq_host); -static irqreturn_t iic_ipi_action (int irq,void *dev_id) {int ipi = (int )(long )dev_id;
Re: [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
Quoted 9 lines · Olof Johansson
Fix two build errors on powerpc allyesconfig +
CONFIG_SMP=n:
arch/powerpc/platforms/built-in.o: In function `cpu_affinity_set':arch/powerpc/platforms/cell/spu_priv1_mmio.c:78: undefined reference to.iic_get_target_id' arch/powerpc/platforms/built-in.o: In functioniic_init_IRQ':arch/powerpc/platforms/cell/interrupt.c:397: undefined reference to `.iic_setup_cpu'Signed-off-by Olof Johansson <[email protected]>
Re: [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
In reply to Olof JohanssonHi Olof,
Just a trivial thing ...
arch/powerpc/platforms/cell/interrupt.c static unsigned int iic_get_irq(void) · line 171
Quoted 7 lines · On Sat, 27 Oct 2007 12:28:51 -0500 Olof Johansson <[email protected]> wrote:
arch/powerpc/platforms/cell/interrupt.c +6
-0+u8 iic_get_target_id (int cpu) +{ +return per_cpu (iic, cpu).target_id; +} + +EXPORT_SYMBOL_GPL (iic_get_target_id);
We don't normally put a blank line between a function and its EXPORT...
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
Quoted 6 lines · Stephen Rothwell
Hi Olof,
Just a trivial thing ...
Quoted 1 line · On Sat, 27 Oct 2007 12:28:51 -0500 Olof Johansson <[email protected]> wrote:
Quoted 8 lines
arch/powerpc/platforms/cell/interrupt.c static unsigned int iic_get_irq(void) · line 171
Quoted 6 lines
arch/powerpc/platforms/cell/interrupt.c +6
-0+u8 iic_get_target_id (int cpu) +{ +return per_cpu (iic, cpu).target_id; +} + +EXPORT_SYMBOL_GPL (iic_get_target_id);We don't normally put a blank line between a function and its EXPORT...
Yeah, sloppy of me, I thought I just copied and pasted. Paulus: feel free to fix up before applying.
Thanks for your feedback,
-Olof