]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: pm-cps: Block system suspend when a JTAG probe is present
authorMatt Redfearn <matt.redfearn@mips.com>
Tue, 20 Feb 2018 09:58:16 +0000 (09:58 +0000)
committerJames Hogan <jhogan@kernel.org>
Fri, 9 Mar 2018 13:53:26 +0000 (13:53 +0000)
commita9e0a1911b9a06ac7eff2eee9327defe5b899d54
treea9014cce241b25f4822bf2f3301194d4b651eb44
parentd8e4fd8a49db8260f055fd22737754f2bd3a06cb
MIPS: pm-cps: Block system suspend when a JTAG probe is present

If a JTAG probe is connected to a MIPS cluster, then the CPC detects it
and latches the CPC.STAT_CONF.EJTAG_PROBE bit to 1. While set,
attempting to send a power-down command to a core will be blocked, and
the CPC will instead send the core to clock-off state. This can
interfere with systems fully entering a low power state where all cores,
CM, GIC, etc are powered down.

Detect that a JTAG probe is / has been connected to the cluster and
block the suspend attempt.

Attempting to suspend the system while a JTAG probe is connected now
yields:
 # echo mem > /sys/power/state
 [   11.654000] PM: Syncing filesystems ... done.
 [   11.658000] JTAG probe is connected - abort suspend
 -sh: echo: write error: Operation not permitted
 #

To restore suspend, the JTAG probe should be disconnected or put into
quiescent state. Platform code can then clear the
CPC.STAT_CONF.EJTAG_PROBE bit.

Reported-by: Ed Blake <ed.blake@sondrel.com>
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/18641/
Signed-off-by: James Hogan <jhogan@kernel.org>
arch/mips/kernel/pm-cps.c