Re: [PATCH] powerpc/86xx: clean up smp init code
On Apr 27, 2009, at 10:06 AM, Martyn Welch wrote: I am using the config in the kernel ("arch/powerpc/configs/68xx/ gef_ppc9a_defconfig") as is, ditto for the DTS. CONFIG_PHYS_64BIT is not set. However, looking into it a bit further 'device_type = "soc";' is missing from the DTS file, so I assume get_immrbase() is returning "-1". That might explain some other weird errors I recently noticed that I haven't managed to find the time to track down yet... I'm amazed this ever worked. If you want to send me a patch for the .dts to add device_type = "soc" for your various .dts I'll get that into 2.6.30 - k ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc/86xx: clean up smp init code
Kumar Gala wrote: On Apr 23, 2009, at 7:54 AM, Martyn Welch wrote: Kumar Gala wrote: Removed the need for asm/mpc86xx.h as it was only used in mpc86xx_smp.c and just moved the defines it cared about into there. Also fixed up the ioremap to only map the one 4k page we need access to and to iounmap when we are done. Signed-off-by: Kumar Gala --- arch/powerpc/include/asm/mpc86xx.h | 33 arch/powerpc/platforms/86xx/gef_ppc9a.c|1 - arch/powerpc/platforms/86xx/gef_sbc310.c |1 - arch/powerpc/platforms/86xx/gef_sbc610.c |1 - arch/powerpc/platforms/86xx/mpc8610_hpcd.c |1 - arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |1 - arch/powerpc/platforms/86xx/mpc86xx_smp.c |8 ++- arch/powerpc/platforms/86xx/sbc8641d.c |1 - 8 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 arch/powerpc/include/asm/mpc86xx.h I assume this patch relies on one of the other patches posted? Just applying this patch to my development tree (based on your main branch) resulted in the following on a PPC9A: mpic: requesting IPIs ... __ioremap(): phys addr 0x0 is RAM lr c041e5c8 Unable to handle kernel paging request for data at address 0x0010 Faulting instruction address: 0xc041e5cc Oops: Kernel access of bad area, sig: 11 [#1] PREEMPT SMP NR_CPUS=2 GE Fanuc PPC9A Modules linked in: NIP: c041e5cc LR: c041e5c8 CTR: c0013d90 REGS: ef841ea0 TRAP: 0300 Not tainted (2.6.30-rc3-00016-gabae74f) MSR: 1032 CR: 2422 XER: DAR: 0010, DSISR: 4000 TASK = ef83f980[1] 'swapper' THREAD: ef84 CPU: 0 GPR00: c041e5c8 ef841f50 ef83f980 1032 c048 4000 GPR08: c0441a4c ef84 c044 2242 dfff 0ff50d00 0001 GPR16: c044 c048 c048 c0468000 c044 c0442838 GPR24: 0002 c048 c048 7d5043a6 9032 0004 0001 c350 NIP [c041e5cc] smp_86xx_kick_cpu+0x70/0x11c LR [c041e5c8] smp_86xx_kick_cpu+0x6c/0x11c Call Trace: [ef841f50] [c041e5c8] smp_86xx_kick_cpu+0x6c/0x11c (unreliable) [ef841f70] [c0435010] __cpu_up+0xa4/0x1b0 [ef841f90] [c04355ec] cpu_up+0x104/0x1cc [ef841fd0] [c0412368] kernel_init+0x1d8/0x1f0 [ef841ff0] [c0012cb8] kernel_thread+0x4c/0x68 Instruction dump: 3c80c000 61290100 38a1 7d234b78 38843464 8369 4bbfa7f9 4bbfcb21 38801000 38631000 4bbf91ad 7c0004ac <81230010> 0c09 4c00012c 3801 ---[ end trace 31fd0ba7d8756001 ]--- Kernel panic - not syncing: Attempted to kill init! Rebooting in 180 seconds.. I'm not able to reproduce this failure. It seems like either ioremap is returning 0 or you are getting 0 from get_immrbase().. either way I don't see how my change would cause what you are seeing on your board. I've just built the kernel with no local patches in case they were causing the problem and adding this patch causes the above problem. Are you running w/CONFIG_PHYS_64BIT=y? I am using the config in the kernel ("arch/powerpc/configs/68xx/gef_ppc9a_defconfig") as is, ditto for the DTS. CONFIG_PHYS_64BIT is not set. However, looking into it a bit further 'device_type = "soc";' is missing from the DTS file, so I assume get_immrbase() is returning "-1". That might explain some other weird errors I recently noticed that I haven't managed to find the time to track down yet... Martyn ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc/86xx: clean up smp init code
On Apr 23, 2009, at 7:54 AM, Martyn Welch wrote: Kumar Gala wrote: Removed the need for asm/mpc86xx.h as it was only used in mpc86xx_smp.c and just moved the defines it cared about into there. Also fixed up the ioremap to only map the one 4k page we need access to and to iounmap when we are done. Signed-off-by: Kumar Gala --- arch/powerpc/include/asm/mpc86xx.h | 33 arch/powerpc/platforms/86xx/gef_ppc9a.c|1 - arch/powerpc/platforms/86xx/gef_sbc310.c |1 - arch/powerpc/platforms/86xx/gef_sbc610.c |1 - arch/powerpc/platforms/86xx/mpc8610_hpcd.c |1 - arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |1 - arch/powerpc/platforms/86xx/mpc86xx_smp.c |8 ++- arch/powerpc/platforms/86xx/sbc8641d.c |1 - 8 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 arch/powerpc/include/asm/mpc86xx.h I assume this patch relies on one of the other patches posted? Just applying this patch to my development tree (based on your main branch) resulted in the following on a PPC9A: mpic: requesting IPIs ... __ioremap(): phys addr 0x0 is RAM lr c041e5c8 Unable to handle kernel paging request for data at address 0x0010 Faulting instruction address: 0xc041e5cc Oops: Kernel access of bad area, sig: 11 [#1] PREEMPT SMP NR_CPUS=2 GE Fanuc PPC9A Modules linked in: NIP: c041e5cc LR: c041e5c8 CTR: c0013d90 REGS: ef841ea0 TRAP: 0300 Not tainted (2.6.30-rc3-00016-gabae74f) MSR: 1032 CR: 2422 XER: DAR: 0010, DSISR: 4000 TASK = ef83f980[1] 'swapper' THREAD: ef84 CPU: 0 GPR00: c041e5c8 ef841f50 ef83f980 1032 c048 4000 GPR08: c0441a4c ef84 c044 2242 dfff 0ff50d00 0001 GPR16: c044 c048 c048 c0468000 c044 c0442838 GPR24: 0002 c048 c048 7d5043a6 9032 0004 0001 c350 NIP [c041e5cc] smp_86xx_kick_cpu+0x70/0x11c LR [c041e5c8] smp_86xx_kick_cpu+0x6c/0x11c Call Trace: [ef841f50] [c041e5c8] smp_86xx_kick_cpu+0x6c/0x11c (unreliable) [ef841f70] [c0435010] __cpu_up+0xa4/0x1b0 [ef841f90] [c04355ec] cpu_up+0x104/0x1cc [ef841fd0] [c0412368] kernel_init+0x1d8/0x1f0 [ef841ff0] [c0012cb8] kernel_thread+0x4c/0x68 Instruction dump: 3c80c000 61290100 38a1 7d234b78 38843464 8369 4bbfa7f9 4bbfcb21 38801000 38631000 4bbf91ad 7c0004ac <81230010> 0c09 4c00012c 3801 ---[ end trace 31fd0ba7d8756001 ]--- Kernel panic - not syncing: Attempted to kill init! Rebooting in 180 seconds.. I'm not able to reproduce this failure. It seems like either ioremap is returning 0 or you are getting 0 from get_immrbase().. either way I don't see how my change would cause what you are seeing on your board. Are you running w/CONFIG_PHYS_64BIT=y? - k - k ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc/86xx: clean up smp init code
On Apr 23, 2009, at 7:54 AM, Martyn Welch wrote: Kumar Gala wrote: Removed the need for asm/mpc86xx.h as it was only used in mpc86xx_smp.c and just moved the defines it cared about into there. Also fixed up the ioremap to only map the one 4k page we need access to and to iounmap when we are done. Signed-off-by: Kumar Gala --- arch/powerpc/include/asm/mpc86xx.h | 33 arch/powerpc/platforms/86xx/gef_ppc9a.c|1 - arch/powerpc/platforms/86xx/gef_sbc310.c |1 - arch/powerpc/platforms/86xx/gef_sbc610.c |1 - arch/powerpc/platforms/86xx/mpc8610_hpcd.c |1 - arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |1 - arch/powerpc/platforms/86xx/mpc86xx_smp.c |8 ++- arch/powerpc/platforms/86xx/sbc8641d.c |1 - 8 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 arch/powerpc/include/asm/mpc86xx.h I assume this patch relies on one of the other patches posted? Just applying this patch to my development tree (based on your main branch) resulted in the following on a PPC9A: Darn, this should have been a simple change. I'll try it out on mpc8641 to see if its happening there. - k ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc/86xx: clean up smp init code
Kumar Gala wrote: Removed the need for asm/mpc86xx.h as it was only used in mpc86xx_smp.c and just moved the defines it cared about into there. Also fixed up the ioremap to only map the one 4k page we need access to and to iounmap when we are done. Signed-off-by: Kumar Gala --- arch/powerpc/include/asm/mpc86xx.h | 33 arch/powerpc/platforms/86xx/gef_ppc9a.c|1 - arch/powerpc/platforms/86xx/gef_sbc310.c |1 - arch/powerpc/platforms/86xx/gef_sbc610.c |1 - arch/powerpc/platforms/86xx/mpc8610_hpcd.c |1 - arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |1 - arch/powerpc/platforms/86xx/mpc86xx_smp.c |8 ++- arch/powerpc/platforms/86xx/sbc8641d.c |1 - 8 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 arch/powerpc/include/asm/mpc86xx.h I assume this patch relies on one of the other patches posted? Just applying this patch to my development tree (based on your main branch) resulted in the following on a PPC9A: mpic: requesting IPIs ... __ioremap(): phys addr 0x0 is RAM lr c041e5c8 Unable to handle kernel paging request for data at address 0x0010 Faulting instruction address: 0xc041e5cc Oops: Kernel access of bad area, sig: 11 [#1] PREEMPT SMP NR_CPUS=2 GE Fanuc PPC9A Modules linked in: NIP: c041e5cc LR: c041e5c8 CTR: c0013d90 REGS: ef841ea0 TRAP: 0300 Not tainted (2.6.30-rc3-00016-gabae74f) MSR: 1032 CR: 2422 XER: DAR: 0010, DSISR: 4000 TASK = ef83f980[1] 'swapper' THREAD: ef84 CPU: 0 GPR00: c041e5c8 ef841f50 ef83f980 1032 c048 4000 GPR08: c0441a4c ef84 c044 2242 dfff 0ff50d00 0001 GPR16: c044 c048 c048 c0468000 c044 c0442838 GPR24: 0002 c048 c048 7d5043a6 9032 0004 0001 c350 NIP [c041e5cc] smp_86xx_kick_cpu+0x70/0x11c LR [c041e5c8] smp_86xx_kick_cpu+0x6c/0x11c Call Trace: [ef841f50] [c041e5c8] smp_86xx_kick_cpu+0x6c/0x11c (unreliable) [ef841f70] [c0435010] __cpu_up+0xa4/0x1b0 [ef841f90] [c04355ec] cpu_up+0x104/0x1cc [ef841fd0] [c0412368] kernel_init+0x1d8/0x1f0 [ef841ff0] [c0012cb8] kernel_thread+0x4c/0x68 Instruction dump: 3c80c000 61290100 38a1 7d234b78 38843464 8369 4bbfa7f9 4bbfcb21 38801000 38631000 4bbf91ad 7c0004ac <81230010> 0c09 4c00012c 3801 ---[ end trace 31fd0ba7d8756001 ]--- Kernel panic - not syncing: Attempted to kill init! Rebooting in 180 seconds.. Martyn ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] powerpc/86xx: clean up smp init code
Removed the need for asm/mpc86xx.h as it was only used in mpc86xx_smp.c and just moved the defines it cared about into there. Also fixed up the ioremap to only map the one 4k page we need access to and to iounmap when we are done. Signed-off-by: Kumar Gala --- arch/powerpc/include/asm/mpc86xx.h | 33 arch/powerpc/platforms/86xx/gef_ppc9a.c|1 - arch/powerpc/platforms/86xx/gef_sbc310.c |1 - arch/powerpc/platforms/86xx/gef_sbc610.c |1 - arch/powerpc/platforms/86xx/mpc8610_hpcd.c |1 - arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |1 - arch/powerpc/platforms/86xx/mpc86xx_smp.c |8 ++- arch/powerpc/platforms/86xx/sbc8641d.c |1 - 8 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 arch/powerpc/include/asm/mpc86xx.h diff --git a/arch/powerpc/include/asm/mpc86xx.h b/arch/powerpc/include/asm/mpc86xx.h deleted file mode 100644 index 15f650f..000 --- a/arch/powerpc/include/asm/mpc86xx.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * MPC86xx definitions - * - * Author: Jeff Brown - * - * Copyright 2004 Freescale Semiconductor, Inc - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#ifdef __KERNEL__ -#ifndef __ASM_POWERPC_MPC86xx_H__ -#define __ASM_POWERPC_MPC86xx_H__ - -#include - -#ifdef CONFIG_PPC_86xx - -#define CPU0_BOOT_RELEASE 0x0100 -#define CPU1_BOOT_RELEASE 0x0200 -#define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE) -#define MCM_PORT_CONFIG_OFFSET 0x1010 - -/* Offset from CCSRBAR */ -#define MPC86xx_MCM_OFFSET (0x0) -#define MPC86xx_MCM_SIZE(0x02000) - -#endif /* CONFIG_PPC_86xx */ -#endif /* __ASM_POWERPC_MPC86xx_H__ */ -#endif /* __KERNEL__ */ diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c index d791046..2efa052 100644 --- a/arch/powerpc/platforms/86xx/gef_ppc9a.c +++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c index af14f85..90754e7 100644 --- a/arch/powerpc/platforms/86xx/gef_sbc310.c +++ b/arch/powerpc/platforms/86xx/gef_sbc310.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c index ea23606..72b31a6 100644 --- a/arch/powerpc/platforms/86xx/gef_sbc610.c +++ b/arch/powerpc/platforms/86xx/gef_sbc610.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c index 3f49a6f..51eec0c 100644 --- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c index c4ec49b..7e9e83c 100644 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c b/arch/powerpc/platforms/86xx/mpc86xx_smp.c index 014e26c..d84bbb5 100644 --- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c +++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -30,6 +29,11 @@ extern void __secondary_start_mpc86xx(void); extern unsigned long __secondary_hold_acknowledge; +#define MCM_PORT_CONFIG_OFFSET 0x10 + +/* Offset from CCSRBAR */ +#define MPC86xx_MCM_OFFSET (0x1000) +#define MPC86xx_MCM_SIZE(0x1000) static void __init smp_86xx_release_core(int nr) @@ -48,6 +52,8 @@ smp_86xx_release_core(int nr) pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2)); pcr |= 1 << (nr + 24); out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr); + + iounmap(mcm_vaddr); } diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c index 2886a36..51c8f33 100644 --- a/arch/powerpc/platforms/86xx/sbc8641d.c +++ b/arch/powerpc/platforms/86xx/sbc8641d.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include -- 1.6.0.6 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev