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

Document why calling smp_call_function will deadlock when called with interrupts disabled.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+13 -1
+13 -1
arch/mips/kernel/smp.c
··· 121 121 * or are or have executed. 122 122 * 123 123 * You must not call this function with disabled interrupts or from a 124 - * hardware interrupt handler or from a bottom half handler. 124 + * hardware interrupt handler or from a bottom half handler: 125 + * 126 + * CPU A CPU B 127 + * Disable interrupts 128 + * smp_call_function() 129 + * Take call_lock 130 + * Send IPIs 131 + * Wait for all cpus to acknowledge IPI 132 + * CPU A has not responded, spin waiting 133 + * for cpu A to respond, holding call_lock 134 + * smp_call_function() 135 + * Spin waiting for call_lock 136 + * Deadlock Deadlock 125 137 */ 126 138 int smp_call_function (void (*func) (void *info), void *info, int retry, 127 139 int wait)