提交 7eaf09ee 编写于 作者: G Geoff Levand 提交者: Benjamin Herrenschmidt

powerpc/ps3: Fix SMP lockdep boot warning

Move the PS3 IPI message setup from ps3_smp_setup_cpu() to ps3_smp_probe().

Fixes startup warnings like these:

  ------------[ cut here ]------------
  WARNING: at kernel/lockdep.c:2649
  Modules linked in:
  ...
  ---[ end trace 31fd0ba7d8756001 ]---
Signed-off-by: NGeoff Levand <geoff@infradead.org>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 72f3bea0
...@@ -59,48 +59,49 @@ static void ps3_smp_message_pass(int cpu, int msg) ...@@ -59,48 +59,49 @@ static void ps3_smp_message_pass(int cpu, int msg)
static int ps3_smp_probe(void) static int ps3_smp_probe(void)
{ {
return 2; int cpu;
}
static void __init ps3_smp_setup_cpu(int cpu) for (cpu = 0; cpu < 2; cpu++) {
{ int result;
int result; unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu);
unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu); int i;
int i;
DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu); DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu);
/* /*
* Check assumptions on ps3_ipi_virqs[] indexing. If this * Check assumptions on ps3_ipi_virqs[] indexing. If this
* check fails, then a different mapping of PPC_MSG_ * check fails, then a different mapping of PPC_MSG_
* to index needs to be setup. * to index needs to be setup.
*/ */
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_CALL_FUNC_SINGLE != 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++) {
result = ps3_event_receive_port_setup(cpu, &virqs[i]); result = ps3_event_receive_port_setup(cpu, &virqs[i]);
if (result) if (result)
continue; continue;
DBG("%s:%d: (%d, %d) => virq %u\n", DBG("%s:%d: (%d, %d) => virq %u\n",
__func__, __LINE__, cpu, i, virqs[i]); __func__, __LINE__, cpu, i, virqs[i]);
result = smp_request_message_ipi(virqs[i], i); result = smp_request_message_ipi(virqs[i], i);
if (result) if (result)
virqs[i] = NO_IRQ; virqs[i] = NO_IRQ;
else else
ps3_register_ipi_irq(cpu, virqs[i]); ps3_register_ipi_irq(cpu, virqs[i]);
} }
ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]); ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]);
DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu);
}
return 2;
} }
void ps3_smp_cleanup_cpu(int cpu) void ps3_smp_cleanup_cpu(int cpu)
...@@ -123,7 +124,6 @@ static struct smp_ops_t ps3_smp_ops = { ...@@ -123,7 +124,6 @@ static struct smp_ops_t ps3_smp_ops = {
.probe = ps3_smp_probe, .probe = ps3_smp_probe,
.message_pass = ps3_smp_message_pass, .message_pass = ps3_smp_message_pass,
.kick_cpu = smp_generic_kick_cpu, .kick_cpu = smp_generic_kick_cpu,
.setup_cpu = ps3_smp_setup_cpu,
}; };
void smp_init_ps3(void) void smp_init_ps3(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册