|
@@ -530,14 +530,19 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
|
|
|
|
|
|
waiting:
|
|
|
secondary = 1;
|
|
|
+ spin_begin();
|
|
|
while (secondary && !xmon_gate) {
|
|
|
if (in_xmon == 0) {
|
|
|
- if (fromipi)
|
|
|
+ if (fromipi) {
|
|
|
+ spin_end();
|
|
|
goto leave;
|
|
|
+ }
|
|
|
secondary = test_and_set_bit(0, &in_xmon);
|
|
|
}
|
|
|
- barrier();
|
|
|
+ spin_cpu_relax();
|
|
|
+ touch_nmi_watchdog();
|
|
|
}
|
|
|
+ spin_end();
|
|
|
|
|
|
if (!secondary && !xmon_gate) {
|
|
|
/* we are the first cpu to come in */
|
|
@@ -568,21 +573,25 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
|
|
|
mb();
|
|
|
xmon_gate = 1;
|
|
|
barrier();
|
|
|
+ touch_nmi_watchdog();
|
|
|
}
|
|
|
|
|
|
cmdloop:
|
|
|
while (in_xmon) {
|
|
|
if (secondary) {
|
|
|
+ spin_begin();
|
|
|
if (cpu == xmon_owner) {
|
|
|
if (!test_and_set_bit(0, &xmon_taken)) {
|
|
|
secondary = 0;
|
|
|
+ spin_end();
|
|
|
continue;
|
|
|
}
|
|
|
/* missed it */
|
|
|
while (cpu == xmon_owner)
|
|
|
- barrier();
|
|
|
+ spin_cpu_relax();
|
|
|
}
|
|
|
- barrier();
|
|
|
+ spin_cpu_relax();
|
|
|
+ touch_nmi_watchdog();
|
|
|
} else {
|
|
|
cmd = cmds(regs);
|
|
|
if (cmd != 0) {
|