aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2014-02-25 19:07:29 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-03-04 23:53:24 -0500
commit402d9a1e02f7215628f13b7c80ff3e98c3a0cadc (patch)
tree5f140acef1455adec52d9f08ab8bdffb8882a67d
parent849401b66d305f3feb75b6db7459b95ad190552a (diff)
powerpc: Free up the slot of PPC_MSG_CALL_FUNC_SINGLE IPI message
The IPI handlers for both PPC_MSG_CALL_FUNC and PPC_MSG_CALL_FUNC_SINGLE map to a common implementation - generic_smp_call_function_single_interrupt(). So, we can consolidate them and save one of the IPI message slots, (which are precious on powerpc, since only 4 of those slots are available). So, implement the functionality of PPC_MSG_CALL_FUNC_SINGLE using PPC_MSG_CALL_FUNC itself and release its IPI message slot, so that it can be used for something else in the future, if desired. Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Preeti U. Murthy <preeti@linux.vnet.ibm.com> Acked-by: Geoff Levand <geoff@infradead.org> [For the PS3 part] Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/include/asm/smp.h2
-rw-r--r--arch/powerpc/kernel/smp.c12
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c2
-rw-r--r--arch/powerpc/platforms/ps3/smp.c2
4 files changed, 8 insertions, 10 deletions
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 084e0807db98..9f7356bf6482 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -120,7 +120,7 @@ extern int cpu_to_core_id(int cpu);
120 * in /proc/interrupts will be wrong!!! --Troy */ 120 * in /proc/interrupts will be wrong!!! --Troy */
121#define PPC_MSG_CALL_FUNCTION 0 121#define PPC_MSG_CALL_FUNCTION 0
122#define PPC_MSG_RESCHEDULE 1 122#define PPC_MSG_RESCHEDULE 1
123#define PPC_MSG_CALL_FUNC_SINGLE 2 123#define PPC_MSG_UNUSED 2
124#define PPC_MSG_DEBUGGER_BREAK 3 124#define PPC_MSG_DEBUGGER_BREAK 3
125 125
126/* for irq controllers that have dedicated ipis per message (4) */ 126/* for irq controllers that have dedicated ipis per message (4) */
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ac2621af3154..ee7d76bfcb4c 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -145,9 +145,9 @@ static irqreturn_t reschedule_action(int irq, void *data)
145 return IRQ_HANDLED; 145 return IRQ_HANDLED;
146} 146}
147 147
148static irqreturn_t call_function_single_action(int irq, void *data) 148static irqreturn_t unused_action(int irq, void *data)
149{ 149{
150 generic_smp_call_function_single_interrupt(); 150 /* This slot is unused and hence available for use, if needed */
151 return IRQ_HANDLED; 151 return IRQ_HANDLED;
152} 152}
153 153
@@ -168,14 +168,14 @@ static irqreturn_t debug_ipi_action(int irq, void *data)
168static irq_handler_t smp_ipi_action[] = { 168static irq_handler_t smp_ipi_action[] = {
169 [PPC_MSG_CALL_FUNCTION] = call_function_action, 169 [PPC_MSG_CALL_FUNCTION] = call_function_action,
170 [PPC_MSG_RESCHEDULE] = reschedule_action, 170 [PPC_MSG_RESCHEDULE] = reschedule_action,
171 [PPC_MSG_CALL_FUNC_SINGLE] = call_function_single_action, 171 [PPC_MSG_UNUSED] = unused_action,
172 [PPC_MSG_DEBUGGER_BREAK] = debug_ipi_action, 172 [PPC_MSG_DEBUGGER_BREAK] = debug_ipi_action,
173}; 173};
174 174
175const char *smp_ipi_name[] = { 175const char *smp_ipi_name[] = {
176 [PPC_MSG_CALL_FUNCTION] = "ipi call function", 176 [PPC_MSG_CALL_FUNCTION] = "ipi call function",
177 [PPC_MSG_RESCHEDULE] = "ipi reschedule", 177 [PPC_MSG_RESCHEDULE] = "ipi reschedule",
178 [PPC_MSG_CALL_FUNC_SINGLE] = "ipi call function single", 178 [PPC_MSG_UNUSED] = "ipi unused",
179 [PPC_MSG_DEBUGGER_BREAK] = "ipi debugger", 179 [PPC_MSG_DEBUGGER_BREAK] = "ipi debugger",
180}; 180};
181 181
@@ -251,8 +251,6 @@ irqreturn_t smp_ipi_demux(void)
251 generic_smp_call_function_interrupt(); 251 generic_smp_call_function_interrupt();
252 if (all & IPI_MESSAGE(PPC_MSG_RESCHEDULE)) 252 if (all & IPI_MESSAGE(PPC_MSG_RESCHEDULE))
253 scheduler_ipi(); 253 scheduler_ipi();
254 if (all & IPI_MESSAGE(PPC_MSG_CALL_FUNC_SINGLE))
255 generic_smp_call_function_single_interrupt();
256 if (all & IPI_MESSAGE(PPC_MSG_DEBUGGER_BREAK)) 254 if (all & IPI_MESSAGE(PPC_MSG_DEBUGGER_BREAK))
257 debug_ipi_action(0, NULL); 255 debug_ipi_action(0, NULL);
258 } while (info->messages); 256 } while (info->messages);
@@ -280,7 +278,7 @@ EXPORT_SYMBOL_GPL(smp_send_reschedule);
280 278
281void arch_send_call_function_single_ipi(int cpu) 279void arch_send_call_function_single_ipi(int cpu)
282{ 280{
283 do_message_pass(cpu, PPC_MSG_CALL_FUNC_SINGLE); 281 do_message_pass(cpu, PPC_MSG_CALL_FUNCTION);
284} 282}
285 283
286void arch_send_call_function_ipi_mask(const struct cpumask *mask) 284void arch_send_call_function_ipi_mask(const struct cpumask *mask)
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 2d42f3bb66d6..adf372606a1c 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -215,7 +215,7 @@ void iic_request_IPIs(void)
215{ 215{
216 iic_request_ipi(PPC_MSG_CALL_FUNCTION); 216 iic_request_ipi(PPC_MSG_CALL_FUNCTION);
217 iic_request_ipi(PPC_MSG_RESCHEDULE); 217 iic_request_ipi(PPC_MSG_RESCHEDULE);
218 iic_request_ipi(PPC_MSG_CALL_FUNC_SINGLE); 218 iic_request_ipi(PPC_MSG_UNUSED);
219 iic_request_ipi(PPC_MSG_DEBUGGER_BREAK); 219 iic_request_ipi(PPC_MSG_DEBUGGER_BREAK);
220} 220}
221 221
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
index 4b35166229fe..00d1a7c2a5a4 100644
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -76,7 +76,7 @@ static int __init ps3_smp_probe(void)
76 76
77 BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0); 77 BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0);
78 BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1); 78 BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1);
79 BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2); 79 BUILD_BUG_ON(PPC_MSG_UNUSED != 2);
80 BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3); 80 BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3);
81 81
82 for (i = 0; i < MSG_COUNT; i++) { 82 for (i = 0; i < MSG_COUNT; i++) {