diff options
author | Soren Brinkmann <soren.brinkmann@xilinx.com> | 2013-08-01 12:36:53 -0400 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2013-08-20 01:32:13 -0400 |
commit | b522877b53cf3f26d7f072616a45e10fe579cd19 (patch) | |
tree | c046826f16217811a59e70531c6be485fc0d62c1 /arch/arm/mach-zynq | |
parent | 3db9e86029349c2c84928b5a0f7c7cf324243b4f (diff) |
arm: zynq: hotplug: Remove unreachable code
zynq_platform_do_lowpower() does never return. Hence remove
all code which relies on that function returning and consolidate the
remains.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/arm/mach-zynq')
-rw-r--r-- | arch/arm/mach-zynq/hotplug.c | 55 |
1 files changed, 5 insertions, 50 deletions
diff --git a/arch/arm/mach-zynq/hotplug.c b/arch/arm/mach-zynq/hotplug.c index c89672bd1de2..5052c70326e4 100644 --- a/arch/arm/mach-zynq/hotplug.c +++ b/arch/arm/mach-zynq/hotplug.c | |||
@@ -40,44 +40,6 @@ static inline void zynq_cpu_enter_lowpower(void) | |||
40 | : "cc"); | 40 | : "cc"); |
41 | } | 41 | } |
42 | 42 | ||
43 | static inline void zynq_cpu_leave_lowpower(void) | ||
44 | { | ||
45 | unsigned int v; | ||
46 | |||
47 | asm volatile( | ||
48 | " mrc p15, 0, %0, c1, c0, 0\n" | ||
49 | " orr %0, %0, %1\n" | ||
50 | " mcr p15, 0, %0, c1, c0, 0\n" | ||
51 | " mrc p15, 0, %0, c1, c0, 1\n" | ||
52 | " orr %0, %0, #0x40\n" | ||
53 | " mcr p15, 0, %0, c1, c0, 1\n" | ||
54 | : "=&r" (v) | ||
55 | : "Ir" (CR_C) | ||
56 | : "cc"); | ||
57 | } | ||
58 | |||
59 | static inline void zynq_platform_do_lowpower(unsigned int cpu, int *spurious) | ||
60 | { | ||
61 | /* | ||
62 | * there is no power-control hardware on this platform, so all | ||
63 | * we can do is put the core into WFI; this is safe as the calling | ||
64 | * code will have already disabled interrupts | ||
65 | */ | ||
66 | for (;;) { | ||
67 | dsb(); | ||
68 | wfi(); | ||
69 | |||
70 | /* | ||
71 | * Getting here, means that we have come out of WFI without | ||
72 | * having been woken up - this shouldn't happen | ||
73 | * | ||
74 | * Just note it happening - when we're woken, we can report | ||
75 | * its occurrence. | ||
76 | */ | ||
77 | (*spurious)++; | ||
78 | } | ||
79 | } | ||
80 | |||
81 | /* | 43 | /* |
82 | * platform-specific code to shutdown a CPU | 44 | * platform-specific code to shutdown a CPU |
83 | * | 45 | * |
@@ -85,20 +47,13 @@ static inline void zynq_platform_do_lowpower(unsigned int cpu, int *spurious) | |||
85 | */ | 47 | */ |
86 | void zynq_platform_cpu_die(unsigned int cpu) | 48 | void zynq_platform_cpu_die(unsigned int cpu) |
87 | { | 49 | { |
88 | int spurious = 0; | ||
89 | |||
90 | /* | ||
91 | * we're ready for shutdown now, so do it | ||
92 | */ | ||
93 | zynq_cpu_enter_lowpower(); | 50 | zynq_cpu_enter_lowpower(); |
94 | zynq_platform_do_lowpower(cpu, &spurious); | ||
95 | 51 | ||
96 | /* | 52 | /* |
97 | * bring this CPU back into the world of cache | 53 | * there is no power-control hardware on this platform, so all |
98 | * coherency, and then restore interrupts | 54 | * we can do is put the core into WFI; this is safe as the calling |
55 | * code will have already disabled interrupts | ||
99 | */ | 56 | */ |
100 | zynq_cpu_leave_lowpower(); | 57 | for (;;) |
101 | 58 | cpu_do_idle(); | |
102 | if (spurious) | ||
103 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
104 | } | 59 | } |