<html><body><p>I tried this with various cases of console usage.  Starting console in beginning, in the middle, never, etc.  Seems to work.  Please get merged ASAP.  Thanks!<br><br><br>Regards,<br>Norman James<br>IBM - POWER Systems Architect<br>Phone: 1-512-286-6807 (T/L: 363-6807)<br>Internet: njames@us.ibm.com<br><br><br><img width="16" height="16" src="cid:1__=8FBBF5C5DFF643378f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for Jeremy Kerr ---02/11/2016 03:03:20 AM---OpenPOWER firmware doesn't like it when the host-side of the "><font color="#424282">Jeremy Kerr ---02/11/2016 03:03:20 AM---OpenPOWER firmware doesn't like it when the host-side of the VUART's FIFO is not drained. This chang</font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">Jeremy Kerr <jk@ozlabs.org></font><br><font size="2" color="#5F5F5F">To:        </font><font size="2">openbmc@lists.ozlabs.org</font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">02/11/2016 03:03 AM</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">[PATCH 1/2] serial/aspeed-vuart: Only disable host tx discard when serial port is in use</font><br><font size="2" color="#5F5F5F">Sent by:        </font><font size="2">"openbmc" <openbmc-bounces+njames=us.ibm.com@lists.ozlabs.org></font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><tt>OpenPOWER firmware doesn't like it when the host-side of the VUART's<br>FIFO is not drained. This change shifts only disables host TX discard<br>mode when the port has been opened.<br><br>Signed-off-by: Jeremy Kerr <jk@ozlabs.org><br>---<br> drivers/tty/serial/aspeed-vuart.c | 40 +++++++++++++++++++++++++++++++++++----<br> 1 file changed, 36 insertions(+), 4 deletions(-)<br><br>diff --git a/drivers/tty/serial/aspeed-vuart.c b/drivers/tty/serial/aspeed-vuart.c<br>index f34884a..73bb0e7 100644<br>--- a/drivers/tty/serial/aspeed-vuart.c<br>+++ b/drivers/tty/serial/aspeed-vuart.c<br>@@ -144,16 +144,45 @@ static ssize_t ast_vuart_set_sirq(struct device *dev,<br> static DEVICE_ATTR(sirq, S_IWUSR | S_IRUGO,<br>                                   ast_vuart_show_sirq, ast_vuart_set_sirq);<br> <br>-static void ast_vuart_setup(struct ast_vuart *vuart)<br>+static void ast_vuart_set_host_tx_discard(struct ast_vuart *vuart, bool discard)<br> {<br>                  u8 reg;<br> <br>-                 /* disable TX discard mode */<br>                  reg = readb(vuart->regs + AST_VUART_GCRA);<br>-                 reg |= AST_VUART_GCRA_HOST_TX_DISCARD;<br>+<br>+                 /* if the HOST_TX_DISCARD bit is set, discard is *disabled* */<br>+                 reg &= ~AST_VUART_GCRA_HOST_TX_DISCARD;<br>+                 if (!discard)<br>+                                  reg |= AST_VUART_GCRA_HOST_TX_DISCARD;<br>+<br>                  writeb(reg, vuart->regs + AST_VUART_GCRA);<br> }<br> <br>+static int ast_vuart_startup(struct uart_port *uart_port)<br>+{<br>+                 struct uart_8250_port *uart_8250_port = up_to_u8250p(uart_port);<br>+                 struct ast_vuart *vuart = uart_8250_port->port.private_data;<br>+                 int rc;<br>+<br>+                 rc = serial8250_do_startup(uart_port);<br>+                 if (rc)<br>+                                  return rc;<br>+<br>+                 ast_vuart_set_host_tx_discard(vuart, false);<br>+<br>+                 return 0;<br>+}<br>+<br>+static void ast_vuart_shutdown(struct uart_port *uart_port)<br>+{<br>+                 struct uart_8250_port *uart_8250_port = up_to_u8250p(uart_port);<br>+                 struct ast_vuart *vuart = uart_8250_port->port.private_data;<br>+<br>+                 ast_vuart_set_host_tx_discard(vuart, true);<br>+<br>+                 serial8250_do_shutdown(uart_port);<br>+}<br>+<br> <br> /**<br>  * The device tree parsing code here is heavily based on that of the of_serial<br>@@ -190,9 +219,12 @@ static int ast_vuart_probe(struct platform_device *pdev)<br>                  }<br> <br>                  memset(&port, 0, sizeof(port));<br>+                 port.port.private_data = vuart;<br>                  port.port.membase = vuart->regs;<br>                  port.port.mapbase = resource.start;<br>                  port.port.mapsize = resource_size(&resource);<br>+                 port.port.startup = ast_vuart_startup;<br>+                 port.port.shutdown = ast_vuart_shutdown;<br> <br>                  if (of_property_read_u32(np, "clock-frequency", &clk)) {<br>                                   vuart->clk = devm_clk_get(&pdev->dev, NULL);<br>@@ -272,8 +304,8 @@ static int ast_vuart_probe(struct platform_device *pdev)<br> <br> <br>                  vuart->line = rc;<br>+                 ast_vuart_set_host_tx_discard(vuart, true);<br>                  platform_set_drvdata(pdev, vuart);<br>-                 ast_vuart_setup(vuart);<br> <br>                  /* extra sysfs control */<br>                  rc = device_create_file(&pdev->dev, &dev_attr_lpc_address);<br>-- <br>2.5.0<br><br>_______________________________________________<br>openbmc mailing list<br>openbmc@lists.ozlabs.org<br></tt><tt><a href="https://lists.ozlabs.org/listinfo/openbmc">https://lists.ozlabs.org/listinfo/openbmc</a></tt><tt><br></tt><br><BR>
</body></html>