Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: oxnas: remove CPU hotplug implementation

The CPU hotplug implementation on this platform is cargo-culted from
the plat-versatile implementation, and is buggy. Once a CPU hits the
"low power" loop, it will wait for pen_release to be set to the CPU
number to wake up again - but nothing in this implementation does that.

So, once a CPU has entered cpu_die() it will never, ever leave.

Remove this useless cargo-culted implementation.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

-114
-1
arch/arm/mach-oxnas/Makefile
··· 1 1 obj-$(CONFIG_SMP) += platsmp.o headsmp.o 2 - obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
-109
arch/arm/mach-oxnas/hotplug.c
··· 1 - /* 2 - * Copyright (C) 2002 ARM Ltd. 3 - * All Rights Reserved 4 - * 5 - * This program is free software; you can redistribute it and/or modify 6 - * it under the terms of the GNU General Public License version 2 as 7 - * published by the Free Software Foundation. 8 - */ 9 - #include <linux/kernel.h> 10 - #include <linux/errno.h> 11 - #include <linux/smp.h> 12 - 13 - #include <asm/cp15.h> 14 - #include <asm/smp_plat.h> 15 - 16 - static inline void cpu_enter_lowpower(void) 17 - { 18 - unsigned int v; 19 - 20 - asm volatile( 21 - " mcr p15, 0, %1, c7, c5, 0\n" 22 - " mcr p15, 0, %1, c7, c10, 4\n" 23 - /* 24 - * Turn off coherency 25 - */ 26 - " mrc p15, 0, %0, c1, c0, 1\n" 27 - " bic %0, %0, #0x20\n" 28 - " mcr p15, 0, %0, c1, c0, 1\n" 29 - " mrc p15, 0, %0, c1, c0, 0\n" 30 - " bic %0, %0, %2\n" 31 - " mcr p15, 0, %0, c1, c0, 0\n" 32 - : "=&r" (v) 33 - : "r" (0), "Ir" (CR_C) 34 - : "cc"); 35 - } 36 - 37 - static inline void cpu_leave_lowpower(void) 38 - { 39 - unsigned int v; 40 - 41 - asm volatile( "mrc p15, 0, %0, c1, c0, 0\n" 42 - " orr %0, %0, %1\n" 43 - " mcr p15, 0, %0, c1, c0, 0\n" 44 - " mrc p15, 0, %0, c1, c0, 1\n" 45 - " orr %0, %0, #0x20\n" 46 - " mcr p15, 0, %0, c1, c0, 1\n" 47 - : "=&r" (v) 48 - : "Ir" (CR_C) 49 - : "cc"); 50 - } 51 - 52 - static inline void platform_do_lowpower(unsigned int cpu, int *spurious) 53 - { 54 - /* 55 - * there is no power-control hardware on this platform, so all 56 - * we can do is put the core into WFI; this is safe as the calling 57 - * code will have already disabled interrupts 58 - */ 59 - for (;;) { 60 - /* 61 - * here's the WFI 62 - */ 63 - asm(".word 0xe320f003\n" 64 - : 65 - : 66 - : "memory", "cc"); 67 - 68 - if (pen_release == cpu_logical_map(cpu)) { 69 - /* 70 - * OK, proper wakeup, we're done 71 - */ 72 - break; 73 - } 74 - 75 - /* 76 - * Getting here, means that we have come out of WFI without 77 - * having been woken up - this shouldn't happen 78 - * 79 - * Just note it happening - when we're woken, we can report 80 - * its occurrence. 81 - */ 82 - (*spurious)++; 83 - } 84 - } 85 - 86 - /* 87 - * platform-specific code to shutdown a CPU 88 - * 89 - * Called with IRQs disabled 90 - */ 91 - void ox820_cpu_die(unsigned int cpu) 92 - { 93 - int spurious = 0; 94 - 95 - /* 96 - * we're ready for shutdown now, so do it 97 - */ 98 - cpu_enter_lowpower(); 99 - platform_do_lowpower(cpu, &spurious); 100 - 101 - /* 102 - * bring this CPU back into the world of cache 103 - * coherency, and then restore interrupts 104 - */ 105 - cpu_leave_lowpower(); 106 - 107 - if (spurious) 108 - pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); 109 - }
-4
arch/arm/mach-oxnas/platsmp.c
··· 19 19 #include <asm/smp_scu.h> 20 20 21 21 extern void ox820_secondary_startup(void); 22 - extern void ox820_cpu_die(unsigned int cpu); 23 22 24 23 static void __iomem *cpu_ctrl; 25 24 static void __iomem *gic_cpu_ctrl; ··· 93 94 static const struct smp_operations ox820_smp_ops __initconst = { 94 95 .smp_prepare_cpus = ox820_smp_prepare_cpus, 95 96 .smp_boot_secondary = ox820_boot_secondary, 96 - #ifdef CONFIG_HOTPLUG_CPU 97 - .cpu_die = ox820_cpu_die, 98 - #endif 99 97 }; 100 98 101 99 CPU_METHOD_OF_DECLARE(ox820_smp, "oxsemi,ox820-smp", &ox820_smp_ops);