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

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: Geoff Levand <geoff@infradead.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Geoff Levand and committed by
Benjamin Herrenschmidt
7eaf09ee 72f3bea0

+32 -32
+32 -32
arch/powerpc/platforms/ps3/smp.c
··· 59 59 60 60 static int ps3_smp_probe(void) 61 61 { 62 - return 2; 63 - } 62 + int cpu; 64 63 65 - static void __init ps3_smp_setup_cpu(int cpu) 66 - { 67 - int result; 68 - unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu); 69 - int i; 64 + for (cpu = 0; cpu < 2; cpu++) { 65 + int result; 66 + unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu); 67 + int i; 70 68 71 - DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu); 69 + DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu); 72 70 73 - /* 74 - * Check assumptions on ps3_ipi_virqs[] indexing. If this 75 - * check fails, then a different mapping of PPC_MSG_ 76 - * to index needs to be setup. 77 - */ 71 + /* 72 + * Check assumptions on ps3_ipi_virqs[] indexing. If this 73 + * check fails, then a different mapping of PPC_MSG_ 74 + * to index needs to be setup. 75 + */ 78 76 79 - BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0); 80 - BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1); 81 - BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2); 82 - BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3); 77 + BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0); 78 + BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1); 79 + BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2); 80 + BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3); 83 81 84 - for (i = 0; i < MSG_COUNT; i++) { 85 - result = ps3_event_receive_port_setup(cpu, &virqs[i]); 82 + for (i = 0; i < MSG_COUNT; i++) { 83 + result = ps3_event_receive_port_setup(cpu, &virqs[i]); 86 84 87 - if (result) 88 - continue; 85 + if (result) 86 + continue; 89 87 90 - DBG("%s:%d: (%d, %d) => virq %u\n", 91 - __func__, __LINE__, cpu, i, virqs[i]); 88 + DBG("%s:%d: (%d, %d) => virq %u\n", 89 + __func__, __LINE__, cpu, i, virqs[i]); 92 90 93 - result = smp_request_message_ipi(virqs[i], i); 91 + result = smp_request_message_ipi(virqs[i], i); 94 92 95 - if (result) 96 - virqs[i] = NO_IRQ; 97 - else 98 - ps3_register_ipi_irq(cpu, virqs[i]); 93 + if (result) 94 + virqs[i] = NO_IRQ; 95 + else 96 + ps3_register_ipi_irq(cpu, virqs[i]); 97 + } 98 + 99 + ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]); 100 + 101 + DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); 99 102 } 100 103 101 - ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]); 102 - 103 - DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); 104 + return 2; 104 105 } 105 106 106 107 void ps3_smp_cleanup_cpu(int cpu) ··· 124 123 .probe = ps3_smp_probe, 125 124 .message_pass = ps3_smp_message_pass, 126 125 .kick_cpu = smp_generic_kick_cpu, 127 - .setup_cpu = ps3_smp_setup_cpu, 128 126 }; 129 127 130 128 void smp_init_ps3(void)