Thread (45 messages) 45 messages, 6 authors, 2016-02-19

Re: [PATCH v3 05/10] serial: mps2-uart: add support for early console

From: Andy Shevchenko <hidden>
Date: 2016-02-16 13:13:55
Also in: linux-api, linux-arm-kernel, linux-devicetree, lkml

On Tue, Feb 16, 2016 at 3:09 PM, Vladimir Murzin
[off-list ref] wrote:
On 16/02/16 10:36, Andy Shevchenko wrote:
quoted
On Tue, Feb 16, 2016 at 12:08 PM, Vladimir Murzin
[off-list ref] wrote:
quoted
This adds support early console for MPS2 UART which can be enabled via
earlycon=mps2,0x40004000
quoted
quoted
+static void mps2_early_putchar(struct uart_port *port, int ch)
+{
+
+       while (readb(port->membase + UARTn_STATE) & UARTn_STATE_TX_FULL)
+               cpu_relax();
Infinite busy loop?
In case of broken hw, yes, but I'm quite unsure how we can help to fix
it. Do you have something in mind?
Set sane amount of loops like

int count = 100;
…
while (… && --count)

Though I have no idea what to do if count == 0. Perhaps it's a TX overrun state.

You may try to recover by flushing TX queue in HW (fifo and / or Tx
shift register) if HW supports it.

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help