summaryrefslogtreecommitdiff
path: root/arch/arm/common
diff options
context:
space:
mode:
authorDima Zavin <dima@android.com>2011-11-09 16:48:00 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:39:18 -0800
commitb4afed20dd3cc670a313c13d88620ce07be38924 (patch)
tree8bde4f8132fb94f90033a26349dbf09c7f431752 /arch/arm/common
parent4c38a69720f669d7d7ced5f4e86298caac885a22 (diff)
ARM: common: fiq_debugger: dump sysrq directly to console if enabled
If the fiq console is enabled, then don't filter the console output while sysrq command is in progress. Change-Id: I9389d757373a5fdca5cbf61f0723667510d3ae88
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/fiq_debugger.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/arch/arm/common/fiq_debugger.c b/arch/arm/common/fiq_debugger.c
index 68e7265cc68d..3ed18ae2ed80 100644
--- a/arch/arm/common/fiq_debugger.c
+++ b/arch/arm/common/fiq_debugger.c
@@ -86,6 +86,7 @@ struct fiq_debugger_state {
struct tty_struct *tty;
int tty_open_count;
struct fiq_debugger_ringbuf *tty_rbuf;
+ bool syslog_dumping;
#endif
unsigned int last_irqs[NR_IRQS];
@@ -496,14 +497,29 @@ static void do_ps(struct fiq_debugger_state *state)
read_unlock(&tasklist_lock);
}
+#ifdef CONFIG_FIQ_DEBUGGER_CONSOLE
+static void begin_syslog_dump(struct fiq_debugger_state *state)
+{
+ state->syslog_dumping = true;
+}
+
+static void end_syslog_dump(struct fiq_debugger_state *state)
+{
+ state->syslog_dumping = false;
+}
+#else
extern int do_syslog(int type, char __user *bug, int count);
-static void do_sysrq(struct fiq_debugger_state *state, char rq)
+static void begin_syslog_dump(struct fiq_debugger_state *state)
+{
+ do_syslog(5 /* clear */, NULL, 0);
+}
+
+static void end_syslog_dump(struct fiq_debugger_state *state)
{
char buf[128];
int ret;
int idx = 0;
- do_syslog(5 /* clear */, NULL, 0);
- handle_sysrq(rq);
+
while (1) {
ret = log_buf_copy(buf, idx, sizeof(buf) - 1);
if (ret <= 0)
@@ -513,6 +529,14 @@ static void do_sysrq(struct fiq_debugger_state *state, char rq)
idx += ret;
}
}
+#endif
+
+static void do_sysrq(struct fiq_debugger_state *state, char rq)
+{
+ begin_syslog_dump(state);
+ handle_sysrq(rq);
+ end_syslog_dump(state);
+}
/* This function CANNOT be called in FIQ context */
static void debug_irq_exec(struct fiq_debugger_state *state, char *cmd)
@@ -871,7 +895,7 @@ static void debug_console_write(struct console *co,
state = container_of(co, struct fiq_debugger_state, console);
- if (!state->console_enable)
+ if (!state->console_enable && !state->syslog_dumping)
return;
debug_uart_enable(state);