char work_cmd[DEBUG_MAX];
#ifdef CONFIG_FIQ_DEBUGGER_CONSOLE
+ spinlock_t console_lock;
struct console console;
struct tty_struct *tty;
int tty_open_count;
state->no_sleep = true;
debug_printf(state, "disabling sleep\n");
} else if (!strcmp(cmd, "console")) {
- state->console_enable = true;
debug_printf(state, "console mode\n");
+ debug_uart_flush(state);
+ state->console_enable = true;
} else if (!strcmp(cmd, "cpu")) {
debug_printf(state, "cpu %d\n", state->current_cpu);
} else if (!strncmp(cmd, "cpu ", 4)) {
}
last_c = c;
}
- debug_uart_flush(state);
+ if (!state->console_enable)
+ debug_uart_flush(state);
if (state->pdata->fiq_ack)
state->pdata->fiq_ack(state->pdev, state->fiq);
const char *s, unsigned int count)
{
struct fiq_debugger_state *state;
+ unsigned long flags;
state = container_of(co, struct fiq_debugger_state, console);
return;
debug_uart_enable(state);
+ spin_lock_irqsave(&state->console_lock, flags);
while (count--) {
if (*s == '\n')
debug_putc(state, '\r');
debug_putc(state, *s++);
}
debug_uart_flush(state);
+ spin_unlock_irqrestore(&state->console_lock, flags);
debug_uart_disable(state);
}
return count;
debug_uart_enable(state);
+ spin_lock_irq(&state->console_lock);
for (i = 0; i < count; i++)
debug_putc(state, *buf++);
+ spin_unlock_irq(&state->console_lock);
debug_uart_disable(state);
return count;
int fiq_tty_write_room(struct tty_struct *tty)
{
- return 1024;
+ return 16;
}
#ifdef CONFIG_CONSOLE_POLL