mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
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>
This commit is contained in:
parent
849401b66d
commit
402d9a1e02
4 changed files with 8 additions and 10 deletions
arch/powerpc
|
@ -120,7 +120,7 @@ extern int cpu_to_core_id(int cpu);
|
||||||
* in /proc/interrupts will be wrong!!! --Troy */
|
* in /proc/interrupts will be wrong!!! --Troy */
|
||||||
#define PPC_MSG_CALL_FUNCTION 0
|
#define PPC_MSG_CALL_FUNCTION 0
|
||||||
#define PPC_MSG_RESCHEDULE 1
|
#define PPC_MSG_RESCHEDULE 1
|
||||||
#define PPC_MSG_CALL_FUNC_SINGLE 2
|
#define PPC_MSG_UNUSED 2
|
||||||
#define PPC_MSG_DEBUGGER_BREAK 3
|
#define PPC_MSG_DEBUGGER_BREAK 3
|
||||||
|
|
||||||
/* for irq controllers that have dedicated ipis per message (4) */
|
/* for irq controllers that have dedicated ipis per message (4) */
|
||||||
|
|
|
@ -145,9 +145,9 @@ static irqreturn_t reschedule_action(int irq, void *data)
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static irqreturn_t call_function_single_action(int irq, void *data)
|
static irqreturn_t unused_action(int irq, void *data)
|
||||||
{
|
{
|
||||||
generic_smp_call_function_single_interrupt();
|
/* This slot is unused and hence available for use, if needed */
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,14 +168,14 @@ static irqreturn_t debug_ipi_action(int irq, void *data)
|
||||||
static irq_handler_t smp_ipi_action[] = {
|
static irq_handler_t smp_ipi_action[] = {
|
||||||
[PPC_MSG_CALL_FUNCTION] = call_function_action,
|
[PPC_MSG_CALL_FUNCTION] = call_function_action,
|
||||||
[PPC_MSG_RESCHEDULE] = reschedule_action,
|
[PPC_MSG_RESCHEDULE] = reschedule_action,
|
||||||
[PPC_MSG_CALL_FUNC_SINGLE] = call_function_single_action,
|
[PPC_MSG_UNUSED] = unused_action,
|
||||||
[PPC_MSG_DEBUGGER_BREAK] = debug_ipi_action,
|
[PPC_MSG_DEBUGGER_BREAK] = debug_ipi_action,
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *smp_ipi_name[] = {
|
const char *smp_ipi_name[] = {
|
||||||
[PPC_MSG_CALL_FUNCTION] = "ipi call function",
|
[PPC_MSG_CALL_FUNCTION] = "ipi call function",
|
||||||
[PPC_MSG_RESCHEDULE] = "ipi reschedule",
|
[PPC_MSG_RESCHEDULE] = "ipi reschedule",
|
||||||
[PPC_MSG_CALL_FUNC_SINGLE] = "ipi call function single",
|
[PPC_MSG_UNUSED] = "ipi unused",
|
||||||
[PPC_MSG_DEBUGGER_BREAK] = "ipi debugger",
|
[PPC_MSG_DEBUGGER_BREAK] = "ipi debugger",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -251,8 +251,6 @@ irqreturn_t smp_ipi_demux(void)
|
||||||
generic_smp_call_function_interrupt();
|
generic_smp_call_function_interrupt();
|
||||||
if (all & IPI_MESSAGE(PPC_MSG_RESCHEDULE))
|
if (all & IPI_MESSAGE(PPC_MSG_RESCHEDULE))
|
||||||
scheduler_ipi();
|
scheduler_ipi();
|
||||||
if (all & IPI_MESSAGE(PPC_MSG_CALL_FUNC_SINGLE))
|
|
||||||
generic_smp_call_function_single_interrupt();
|
|
||||||
if (all & IPI_MESSAGE(PPC_MSG_DEBUGGER_BREAK))
|
if (all & IPI_MESSAGE(PPC_MSG_DEBUGGER_BREAK))
|
||||||
debug_ipi_action(0, NULL);
|
debug_ipi_action(0, NULL);
|
||||||
} while (info->messages);
|
} while (info->messages);
|
||||||
|
@ -280,7 +278,7 @@ EXPORT_SYMBOL_GPL(smp_send_reschedule);
|
||||||
|
|
||||||
void arch_send_call_function_single_ipi(int cpu)
|
void arch_send_call_function_single_ipi(int cpu)
|
||||||
{
|
{
|
||||||
do_message_pass(cpu, PPC_MSG_CALL_FUNC_SINGLE);
|
do_message_pass(cpu, PPC_MSG_CALL_FUNCTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
void arch_send_call_function_ipi_mask(const struct cpumask *mask)
|
void arch_send_call_function_ipi_mask(const struct cpumask *mask)
|
||||||
|
|
|
@ -215,7 +215,7 @@ void iic_request_IPIs(void)
|
||||||
{
|
{
|
||||||
iic_request_ipi(PPC_MSG_CALL_FUNCTION);
|
iic_request_ipi(PPC_MSG_CALL_FUNCTION);
|
||||||
iic_request_ipi(PPC_MSG_RESCHEDULE);
|
iic_request_ipi(PPC_MSG_RESCHEDULE);
|
||||||
iic_request_ipi(PPC_MSG_CALL_FUNC_SINGLE);
|
iic_request_ipi(PPC_MSG_UNUSED);
|
||||||
iic_request_ipi(PPC_MSG_DEBUGGER_BREAK);
|
iic_request_ipi(PPC_MSG_DEBUGGER_BREAK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ static int __init ps3_smp_probe(void)
|
||||||
|
|
||||||
BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0);
|
BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0);
|
||||||
BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1);
|
BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1);
|
||||||
BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2);
|
BUILD_BUG_ON(PPC_MSG_UNUSED != 2);
|
||||||
BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3);
|
BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3);
|
||||||
|
|
||||||
for (i = 0; i < MSG_COUNT; i++) {
|
for (i = 0; i < MSG_COUNT; i++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue