.. | .. |
---|
179 | 179 | |
---|
180 | 180 | if (lsr & UART_LSR_DR) { |
---|
181 | 181 | temp = rk_fiq_read(t, UART_RX); |
---|
182 | | - buf[n & 0x1f] = temp; |
---|
183 | | - n++; |
---|
184 | | - if (temp == 'q' && n > 2) { |
---|
185 | | - if ((buf[(n - 2) & 0x1f] == 'i') && |
---|
186 | | - (buf[(n - 3) & 0x1f] == 'f')) |
---|
| 182 | + buf[++n & 0x1f] = temp; |
---|
| 183 | + |
---|
| 184 | + if (temp == 'q') { |
---|
| 185 | + if ((buf[(n - 1) & 0x1f] == 'i') && |
---|
| 186 | + (buf[(n - 2) & 0x1f] == 'f') && |
---|
| 187 | + (buf[(n - 3) & 0x1f] != '_') && |
---|
| 188 | + (buf[(n - 3) & 0x1f] != ' ')) |
---|
187 | 189 | return FIQ_DEBUGGER_BREAK; |
---|
188 | 190 | else |
---|
189 | 191 | return temp; |
---|
.. | .. |
---|
334 | 336 | unsigned int dropped; |
---|
335 | 337 | |
---|
336 | 338 | set_current_state(TASK_INTERRUPTIBLE); |
---|
337 | | - if (kfifo_is_empty(&fifo) && kfifo_is_empty(&tty_fifo)) { |
---|
| 339 | + if (console_thread_stop || (kfifo_is_empty(&fifo) && kfifo_is_empty(&tty_fifo))) { |
---|
338 | 340 | smp_store_mb(console_thread_running, false); |
---|
339 | 341 | schedule(); |
---|
340 | 342 | smp_store_mb(console_thread_running, true); |
---|
.. | .. |
---|
344 | 346 | set_current_state(TASK_RUNNING); |
---|
345 | 347 | |
---|
346 | 348 | while (!console_thread_stop && (!kfifo_is_empty(&fifo) || !kfifo_is_empty(&tty_fifo))) { |
---|
347 | | - while (kfifo_get(&fifo, &c)) { |
---|
| 349 | + while (!console_thread_stop && kfifo_get(&fifo, &c)) { |
---|
348 | 350 | console_put(pdev, &c, 1); |
---|
349 | 351 | if (c == '\n') |
---|
350 | 352 | break; |
---|
351 | 353 | } |
---|
352 | 354 | |
---|
353 | | - while (kfifo_get(&tty_fifo, &c)) { |
---|
| 355 | + while (!console_thread_stop && kfifo_get(&tty_fifo, &c)) { |
---|
354 | 356 | console_putc(pdev, c); |
---|
355 | 357 | len_tty++; |
---|
356 | 358 | if (c == '\n') |
---|
.. | .. |
---|
418 | 420 | unsigned int ret = 0; |
---|
419 | 421 | struct rk_fiq_debugger *t; |
---|
420 | 422 | |
---|
| 423 | + if (console_thread_stop) |
---|
| 424 | + return count; |
---|
421 | 425 | t = container_of(dev_get_platdata(&pdev->dev), typeof(*t), pdata); |
---|
422 | 426 | |
---|
423 | 427 | if (count > 0) { |
---|