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

MIPS: idle: Workaround wait + FDC problems

On certain cores (namely proAptiv and P5600) incoming data via a Fast
Debug Channel (FDC) while the core is blocked on a wait instruction will
cause the wait not to wake up even when another interrupt is received.
This makes an idle target stop as soon as you send FDC data to it, until
the debug probe interrupts it and restarts the wait instruction.

This is worked around by avoiding using r4k_wait on these cores if
CONFIG_MIPS_EJTAG_FDC_TTY is enabled (which would imply the user intends
to use the FDC).

[ralf@linux-mips.org: Fix conflict.]

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/9144/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

James Hogan and committed by
Ralf Baechle
e38df288 602e8a34

+11 -2
+11 -2
arch/mips/kernel/idle.c
··· 176 176 cpu_wait = rm7k_wait_irqoff; 177 177 break; 178 178 179 + case CPU_PROAPTIV: 180 + case CPU_P5600: 181 + /* 182 + * Incoming Fast Debug Channel (FDC) data during a wait 183 + * instruction causes the wait never to resume, even if an 184 + * interrupt is received. Avoid using wait at all if FDC data is 185 + * likely to be received. 186 + */ 187 + if (IS_ENABLED(CONFIG_MIPS_EJTAG_FDC_TTY)) 188 + break; 189 + /* fall through */ 179 190 case CPU_M14KC: 180 191 case CPU_M14KEC: 181 192 case CPU_24K: ··· 194 183 case CPU_1004K: 195 184 case CPU_1074K: 196 185 case CPU_INTERAPTIV: 197 - case CPU_PROAPTIV: 198 - case CPU_P5600: 199 186 case CPU_M5150: 200 187 case CPU_QEMU_GENERIC: 201 188 cpu_wait = r4k_wait;