diff options
Diffstat (limited to 'arch/powerpc/xmon')
| -rw-r--r-- | arch/powerpc/xmon/xmon.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index a90731b3d44a..b07909850f77 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
| @@ -309,16 +309,23 @@ static void get_output_lock(void) | |||
| 309 | 309 | ||
| 310 | if (xmon_speaker == me) | 310 | if (xmon_speaker == me) |
| 311 | return; | 311 | return; |
| 312 | |||
| 312 | for (;;) { | 313 | for (;;) { |
| 313 | if (xmon_speaker == 0) { | 314 | last_speaker = cmpxchg(&xmon_speaker, 0, me); |
| 314 | last_speaker = cmpxchg(&xmon_speaker, 0, me); | 315 | if (last_speaker == 0) |
| 315 | if (last_speaker == 0) | 316 | return; |
| 316 | return; | 317 | |
| 317 | } | 318 | /* |
| 318 | timeout = 10000000; | 319 | * Wait a full second for the lock, we might be on a slow |
| 320 | * console, but check every 100us. | ||
| 321 | */ | ||
| 322 | timeout = 10000; | ||
| 319 | while (xmon_speaker == last_speaker) { | 323 | while (xmon_speaker == last_speaker) { |
| 320 | if (--timeout > 0) | 324 | if (--timeout > 0) { |
| 325 | udelay(100); | ||
| 321 | continue; | 326 | continue; |
| 327 | } | ||
| 328 | |||
| 322 | /* hostile takeover */ | 329 | /* hostile takeover */ |
| 323 | prev = cmpxchg(&xmon_speaker, last_speaker, me); | 330 | prev = cmpxchg(&xmon_speaker, last_speaker, me); |
| 324 | if (prev == last_speaker) | 331 | if (prev == last_speaker) |
| @@ -397,7 +404,6 @@ static int xmon_core(struct pt_regs *regs, int fromipi) | |||
| 397 | } | 404 | } |
| 398 | 405 | ||
| 399 | xmon_fault_jmp[cpu] = recurse_jmp; | 406 | xmon_fault_jmp[cpu] = recurse_jmp; |
| 400 | cpumask_set_cpu(cpu, &cpus_in_xmon); | ||
| 401 | 407 | ||
| 402 | bp = NULL; | 408 | bp = NULL; |
| 403 | if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) | 409 | if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) |
| @@ -419,6 +425,8 @@ static int xmon_core(struct pt_regs *regs, int fromipi) | |||
| 419 | release_output_lock(); | 425 | release_output_lock(); |
| 420 | } | 426 | } |
| 421 | 427 | ||
| 428 | cpumask_set_cpu(cpu, &cpus_in_xmon); | ||
| 429 | |||
| 422 | waiting: | 430 | waiting: |
| 423 | secondary = 1; | 431 | secondary = 1; |
| 424 | while (secondary && !xmon_gate) { | 432 | while (secondary && !xmon_gate) { |
