android_kernel_motorola_sm6225/arch/arm
Javier Martinez Canillas c5dff4ffd3 ARM: 7480/1: only call smp_send_stop() on SMP
On reboot or poweroff (machine_shutdown()) a call to smp_send_stop() is
made (to stop the others CPU's) when CONFIG_SMP=y.

arch/arm/kernel/process.c:

void machine_shutdown(void)
{
 #ifdef CONFIG_SMP
       smp_send_stop();
 #endif
}

smp_send_stop() calls the function pointer smp_cross_call(), which is set
on the smp_init_cpus() function for OMAP processors.

arch/arm/mach-omap2/omap-smp.c:

void __init smp_init_cpus(void)
{
...
	set_smp_cross_call(gic_raise_softirq);
...
}

But the ARM setup_arch() function only calls smp_init_cpus()
if CONFIG_SMP=y && is_smp().

arm/kernel/setup.c:

void __init setup_arch(char **cmdline_p)
{
...
 #ifdef CONFIG_SMP
	if (is_smp())
		smp_init_cpus();
 #endif
...
}

Newer OMAP CPU's are SMP machines so omap2plus_defconfig sets
CONFIG_SMP=y. Unfortunately on an OMAP UP machine is_smp()
returns false and smp_init_cpus() is never called and the
smp_cross_call() function remains NULL.

If the machine is rebooted or powered off, smp_send_stop() will
be called (since CONFIG_SMP=y) leading to the following error:

[   42.815551] Restarting system.
[   42.819030] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   42.827667] pgd = d7a74000
[   42.830566] [00000000] *pgd=96ce7831, *pte=00000000, *ppte=00000000
[   42.837249] Internal error: Oops: 80000007 [#1] SMP ARM
[   42.842773] Modules linked in:
[   42.846008] CPU: 0    Not tainted  (3.5.0-rc3-next-20120622-00002-g62e87ba-dirty #44)
[   42.854278] PC is at 0x0
[   42.856994] LR is at smp_send_stop+0x4c/0xe4
[   42.861511] pc : [<00000000>]    lr : [<c00183a4>]    psr: 60000013
[   42.861511] sp : d6c85e70  ip : 00000000  fp : 00000000
[   42.873626] r10: 00000000  r9 : d6c84000  r8 : 00000002
[   42.879150] r7 : c07235a0  r6 : c06dd2d0  r5 : 000f4241  r4 : d6c85e74
[   42.886047] r3 : 00000000  r2 : 00000000  r1 : 00000006  r0 : d6c85e74
[   42.892944] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   42.900482] Control: 10c5387d  Table: 97a74019  DAC: 00000015
[   42.906555] Process reboot (pid: 1166, stack limit = 0xd6c842f8)
[   42.912902] Stack: (0xd6c85e70 to 0xd6c86000)
[   42.917510] 5e60:                                     c07235a0 00000000 00000000 d6c84000
[   42.926177] 5e80: 01234567 c00143d0 4321fedc c00511bc d6c85ebc 00000168 00000460 00000000
[   42.934814] 5ea0: c1017950 a0000013 c1017900 d8014390 d7ec3858 c0498e48 c1017950 00000000
[   42.943481] 5ec0: d6ddde10 d6c85f78 00000003 00000000 d6ddde10 d6c84000 00000000 00000000
[   42.952117] 5ee0: 00000002 00000000 00000000 c0088c88 00000002 00000000 00000000 c00f4b90
[   42.960784] 5f00: 00000000 d6c85ebc d8014390 d7e311c8 60000013 00000103 00000002 d6c84000
[   42.969421] 5f20: c00f3274 d6e00a00 00000001 60000013 d6c84000 00000000 00000000 c00895d4
[   42.978057] 5f40: 00000002 d8007c80 d781f000 c00f6150 d8010cc0 c00f3274 d781f000 d6c84000
[   42.986694] 5f60: c0013020 d6e00a00 00000001 20000010 0001257c ef000000 00000000 c00895d4
[   42.995361] 5f80: 00000002 00000001 00000003 00000000 00000001 00000003 00000000 00000058
[   43.003997] 5fa0: c00130c8 c0012f00 00000001 00000003 fee1dead 28121969 01234567 00000002
[   43.012634] 5fc0: 00000001 00000003 00000000 00000058 00012584 0001257c 00000001 00000000
[   43.021270] 5fe0: 000124bc bec5cc6c 00008f9c 4a2f7c40 20000010 fee1dead 00000000 00000000
[   43.029968] [<c00183a4>] (smp_send_stop+0x4c/0xe4) from [<c00143d0>] (machine_restart+0xc/0x4c)
[   43.039154] [<c00143d0>] (machine_restart+0xc/0x4c) from [<c00511bc>] (sys_reboot+0x144/0x1f0)
[   43.048278] [<c00511bc>] (sys_reboot+0x144/0x1f0) from [<c0012f00>] (ret_fast_syscall+0x0/0x3c)
[   43.057464] Code: bad PC value
[   43.060760] ---[ end trace c3988d1dd0b8f0fb ]---

Add a check so smp_cross_call() is only called when there is more than one CPU on-line.

Cc: <stable@vger.kernel.org>
Signed-off-by: Javier Martinez Canillas <javier at dowhile0.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-07-31 10:30:44 +01:00
..
boot ARM: SoC fixes 2012-06-24 10:57:59 -07:00
common ARM: dma-mapping: fix debug messages in dmabounce code 2012-06-13 14:25:16 +02:00
configs ARM: ux500: Provide regulator support for SMSC911x via Device Tree 2012-06-01 02:04:46 +02:00
include/asm ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+ 2012-07-31 10:30:41 +01:00
kernel ARM: 7480/1: only call smp_send_stop() on SMP 2012-07-31 10:30:44 +01:00
lib ARM: Remove support for ARMv3 ARM610 and ARM710 CPUs 2012-05-05 05:50:50 +01:00
mach-at91 Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-05-25 09:31:59 -07:00
mach-bcmring ARM: bcmring: fix UART declarations 2012-04-18 21:21:45 -07:00
mach-clps711x ARM: clps711x: Cleanup IRQ handling 2012-05-15 21:20:59 +02:00
mach-cns3xxx ARM: PCI: provide a default bus scan implementation 2012-05-13 17:12:17 +01:00
mach-davinci arm-soc: sweeping late_initcall cleanup 2012-05-26 13:14:01 -07:00
mach-dove ARM: Orion: Fix WDT compile for Dove and MV78xx0 2012-07-04 10:37:34 +02:00
mach-ebsa110
mach-ep93xx - More robust parsing especially of xattr data in JFFS2 2012-06-01 16:55:42 -07:00
mach-exynos ARM: EXYNOS: Fix EXYNOS_DEV_DMA Kconfig entry 2012-06-27 10:03:00 +09:00
mach-footbridge ARM: PCI: provide a default bus scan implementation 2012-05-13 17:12:17 +01:00
mach-gemini
mach-h720x
mach-highbank ARM: highbank: Add smc calls to enable/disable the L2 2012-06-07 22:39:43 -07:00
mach-imx ARM: imx: assert SCC gate stays enabled 2012-07-04 09:38:29 +02:00
mach-integrator Merge branches 'amba', 'devel-stable', 'fixes', 'mach-types', 'mmci', 'pci' and 'versatile' into for-linus 2012-05-21 15:15:10 +01:00
mach-iop13xx ARM: PCI: get rid of pci_std_swizzle() 2012-05-13 17:12:16 +01:00
mach-iop32x ARM: PCI: provide a default bus scan implementation 2012-05-13 17:12:17 +01:00
mach-iop33x ARM: PCI: provide a default bus scan implementation 2012-05-13 17:12:17 +01:00
mach-ixp4xx - More robust parsing especially of xattr data in JFFS2 2012-06-01 16:55:42 -07:00
mach-kirkwood ARM: Orion: Fix Virtual/Physical mixup with watchdog 2012-06-23 16:19:21 -07:00
mach-ks8695 ARM: PCI: provide a default bus scan implementation 2012-05-13 17:12:17 +01:00
mach-l7200/include/mach
mach-lpc32xx GPIO driver changes for v3.5 merge window 2012-05-24 14:01:46 -07:00
mach-mmp ARM: mmp: remove mach/gpio-pxa.h 2012-07-04 15:58:11 +08:00
mach-msm arm-soc: sweeping late_initcall cleanup 2012-05-26 13:14:01 -07:00
mach-mv78xx0 ARM: Orion: Fix WDT compile for Dove and MV78xx0 2012-07-04 10:37:34 +02:00
mach-mxs ARM: apx4devkit: fix FEC enabling PHY clock 2012-07-05 16:08:01 +08:00
mach-netx
mach-nomadik - More robust parsing especially of xattr data in JFFS2 2012-06-01 16:55:42 -07:00
mach-omap1 - More robust parsing especially of xattr data in JFFS2 2012-06-01 16:55:42 -07:00
mach-omap2 A few more OMAP fixes for 3.5-rc. These fix some bugs with power 2012-07-05 01:12:08 -07:00
mach-orion5x ARM: Orion: Fix Virtual/Physical mixup with watchdog 2012-06-23 16:19:21 -07:00
mach-picoxcell
mach-pnx4008 arm-soc: sweeping late_initcall cleanup 2012-05-26 13:14:01 -07:00
mach-prima2 arm-soc: sweeping late_initcall cleanup 2012-05-26 13:14:01 -07:00
mach-pxa ARM: pxa: hx4700: Fix basic suspend/resume 2012-07-01 14:40:58 +08:00
mach-realview
mach-rpc
mach-s3c24xx fbdev updates for 3.5 2012-06-01 16:57:51 -07:00
mach-s3c64xx fbdev updates for 3.5 2012-06-01 16:57:51 -07:00
mach-s3c2410
mach-s3c2412
mach-s3c2440
mach-s5p64x0 fbdev updates for 3.5 2012-06-01 16:57:51 -07:00
mach-s5pc100 fbdev updates for 3.5 2012-06-01 16:57:51 -07:00
mach-s5pv210 fbdev updates for 3.5 2012-06-01 16:57:51 -07:00
mach-sa1100 Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-05-29 18:21:44 -07:00
mach-shark ARM: PCI: provide a default bus scan implementation 2012-05-13 17:12:17 +01:00
mach-shmobile ARM: shmobile: r8a7779: Route all interrupts to ARM 2012-06-23 01:12:09 +02:00
mach-spear3xx Viresh has moved 2012-06-20 14:39:36 -07:00
mach-spear6xx Viresh has moved 2012-06-20 14:39:36 -07:00
mach-spear13xx Viresh has moved 2012-06-20 14:39:36 -07:00
mach-tegra ARM: tegra: make tegra_cpu_reset_handler_enable() __init 2012-06-18 16:42:57 -07:00
mach-u300 ARM: u300: bump all IRQ numbers by one 2012-04-20 09:52:58 +02:00
mach-ux500 serial/amba-pl011: move custom pin control to driver 2012-06-12 15:41:44 -07:00
mach-versatile ARM: fix mach-versatile/pci.c warning 2012-07-04 17:04:57 +01:00
mach-vexpress Merge branch 'late/soc' into devel-late 2012-05-30 16:06:46 -07:00
mach-vt8500
mach-w90x900
mach-zynq
mm ARM: 7478/1: errata: extend workaround for erratum #720789 2012-07-31 10:30:43 +01:00
net ARM: 7421/1: bpf_jit: BPF_S_ANC_ALU_XOR_X support 2012-06-14 15:12:13 +01:00
nwfpe
oprofile
plat-iop ARM: PCI: provide a default bus scan implementation 2012-05-13 17:12:17 +01:00
plat-mxc Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-06-25 14:53:09 -07:00
plat-nomadik ARM: nomadik: enable PINCTRL_NOMADIK where needed 2012-05-15 14:42:57 +02:00
plat-omap Some uncontroversial OMAP clock, hwmod, and compiler warning fixes for 3.5-rc 2012-06-23 16:16:29 -07:00
plat-orion ARM: Orion: Fix Virtual/Physical mixup with watchdog 2012-06-23 16:19:21 -07:00
plat-pxa ARM: MMP: add pxa910-ssp into ssp_id_table 2012-06-11 12:25:50 +08:00
plat-s3c24xx ARM: S3C24XX: move common clock init into common.c 2012-05-12 16:22:18 +09:00
plat-samsung ARM: SAMSUNG: Fix for S3C2412 EBI memory mapping 2012-06-21 03:53:46 +09:00
plat-spear Viresh has moved 2012-06-20 14:39:36 -07:00
plat-versatile ARM: 7389/2: plat-versatile: modernize FPGA IRQ controller 2012-05-04 16:53:37 +01:00
tools ARM: Update mach-types 2012-04-26 08:46:02 +01:00
vfp ARM: 7477/1: vfp: Always save VFP state in vfp_pm_suspend on UP 2012-07-31 10:30:43 +01:00
Kconfig ARM: Orion5x - Restore parts of io.h, with rework 2012-06-23 16:18:17 -07:00
Kconfig-nommu
Kconfig.debug arm-soc: device tree conversions, part 2 2012-05-26 12:57:47 -07:00
Makefile arm-soc: soc specific changes, part 2 2012-05-26 13:05:55 -07:00