aboutsummaryrefslogtreecommitdiff
path: root/kernel/debug/kdb/kdb_main.c
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2014-07-01 16:09:02 +0100
committerDaniel Thompson <daniel.thompson@linaro.org>2015-01-05 15:46:14 +0000
commit0493ee78434956f5d6e17b20eedfbf79e4f3814d (patch)
tree0d31484a98ee5b8e78a92f47f0e3948aa6b2850b /kernel/debug/kdb/kdb_main.c
parent70691b13d2b7876ab50f68ccba1c604d9b181fb2 (diff)
kgdb: Timeout if secondary CPUs ignore the roundupdev/kgdb-timeout
Currently if an active CPU fails to respond to a roundup request the CPU that requested the roundup will become stuck. This needlessly reduces the robustness of the debugger. This patch introduces a timeout allowing the system state to be examined even when the system contains unresponsive processors. It also modifies kdb's cpu command to make it censor attempts to switch to unresponsive processors and to report their state as (D)ead. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Mike Travis <travis@sgi.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Dimitri Sivanich <sivanich@sgi.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Borislav Petkov <bp@suse.de> Cc: kgdb-bugreport@lists.sourceforge.net Cc: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/debug/kdb/kdb_main.c')
-rw-r--r--kernel/debug/kdb/kdb_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 379650b984f8..0c1dc7fa2e58 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -2157,6 +2157,8 @@ static void kdb_cpu_status(void)
for (start_cpu = -1, i = 0; i < NR_CPUS; i++) {
if (!cpu_online(i)) {
state = 'F'; /* cpu is offline */
+ } else if (!kgdb_info[i].enter_kgdb) {
+ state = 'D'; /* cpu is online but unresponsive */
} else {
state = ' '; /* cpu is responding to kdb */
if (kdb_task_state_char(KDB_TSK(i)) == 'I')
@@ -2210,7 +2212,7 @@ static int kdb_cpu(int argc, const char **argv)
/*
* Validate cpunum
*/
- if ((cpunum > NR_CPUS) || !cpu_online(cpunum))
+ if ((cpunum >= CONFIG_NR_CPUS) || !kgdb_info[cpunum].enter_kgdb)
return KDB_BADCPUNUM;
dbg_switch_cpu = cpunum;