Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338433
b: refs/heads/master
c: 40f70c0
h: refs/heads/master
i:
  338431: 14bfec1
v: v3
  • Loading branch information
Shinya Kuribayashi authored and Greg Kroah-Hartman committed Nov 16, 2012
1 parent d750374 commit f09e64b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c66d6d2a1a572768616ddca2c3863384b14d846
refs/heads/master: 40f70c03e33a1eed3f3fcd13418e76abad77d117
23 changes: 22 additions & 1 deletion trunk/drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2203,14 +2203,35 @@ static void serial_console_write(struct console *co, const char *s,
{
struct sci_port *sci_port = &sci_ports[co->index];
struct uart_port *port = &sci_port->port;
unsigned short bits;
unsigned short bits, ctrl;
unsigned long flags;
int locked = 1;

local_irq_save(flags);
if (port->sysrq)
locked = 0;
else if (oops_in_progress)
locked = spin_trylock(&port->lock);
else
spin_lock(&port->lock);

/* first save the SCSCR then disable the interrupts */
ctrl = serial_port_in(port, SCSCR);
serial_port_out(port, SCSCR, sci_port->cfg->scscr);

uart_console_write(port, s, count, serial_console_putchar);

/* wait until fifo is empty and last bit has been transmitted */
bits = SCxSR_TDxE(port) | SCxSR_TEND(port);
while ((serial_port_in(port, SCxSR) & bits) != bits)
cpu_relax();

/* restore the SCSCR */
serial_port_out(port, SCSCR, ctrl);

if (locked)
spin_unlock(&port->lock);
local_irq_restore(flags);
}

static int __devinit serial_console_setup(struct console *co, char *options)
Expand Down

0 comments on commit f09e64b

Please sign in to comment.