diff options
| author | Jason Wessel <jason.wessel@windriver.com> | 2015-01-08 16:46:55 -0500 |
|---|---|---|
| committer | Jason Wessel <jason.wessel@windriver.com> | 2015-02-19 13:39:02 -0500 |
| commit | df0036d117e6c9df36324e517728e33543065f9a (patch) | |
| tree | c1b944a4cbbe24ec31103ee2e229a17c561293ce /kernel/debug | |
| parent | 146755923262037fc4c54abc28c04b1103f3cc51 (diff) | |
kdb: Fix off by one error in kdb_cpu()
There was a follow on replacement patch against the prior
"kgdb: Timeout if secondary CPUs ignore the roundup".
See: https://lkml.org/lkml/2015/1/7/442
This patch is the delta vs the patch that was committed upstream:
* Fix an off-by-one error in kdb_cpu().
* Replace NR_CPUS with CONFIG_NR_CPUS to tell checkpatch that we
really want a static limit.
* Removed the "KGDB: " prefix from the pr_crit() in debug_core.c
(kgdb-next contains a patch which introduced pr_fmt() to this file
to the tag will now be applied automatically).
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'kernel/debug')
| -rw-r--r-- | kernel/debug/debug_core.c | 2 | ||||
| -rw-r--r-- | kernel/debug/kdb/kdb_main.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 07ce18ca71e0..ac5c0f9c7a20 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c | |||
| @@ -604,7 +604,7 @@ return_normal: | |||
| 604 | online_cpus) | 604 | online_cpus) |
| 605 | cpu_relax(); | 605 | cpu_relax(); |
| 606 | if (!time_left) | 606 | if (!time_left) |
| 607 | pr_crit("KGDB: Timed out waiting for secondary CPUs.\n"); | 607 | pr_crit("Timed out waiting for secondary CPUs.\n"); |
| 608 | 608 | ||
| 609 | /* | 609 | /* |
| 610 | * At this point the primary processor is completely | 610 | * At this point the primary processor is completely |
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index c6d2c0b1565d..60f6bb817f70 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c | |||
| @@ -2256,7 +2256,7 @@ static int kdb_cpu(int argc, const char **argv) | |||
| 2256 | /* | 2256 | /* |
| 2257 | * Validate cpunum | 2257 | * Validate cpunum |
| 2258 | */ | 2258 | */ |
| 2259 | if ((cpunum > NR_CPUS) || !kgdb_info[cpunum].enter_kgdb) | 2259 | if ((cpunum >= CONFIG_NR_CPUS) || !kgdb_info[cpunum].enter_kgdb) |
| 2260 | return KDB_BADCPUNUM; | 2260 | return KDB_BADCPUNUM; |
| 2261 | 2261 | ||
| 2262 | dbg_switch_cpu = cpunum; | 2262 | dbg_switch_cpu = cpunum; |
