lkml.org 
[lkml]   [2010]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] serial: revert "Use block_til_ready helper"
Date
On Monday 21 June 2010 16:13:09 Alan Cox wrote:

> and paste it into
>
> void tty_port_raise_dtr_rts(struct tty_port *port)
> {
> if (port->ops->dtr_rts)
> port->ops->dtr_rts(port, 1);
>
> -->> HERE <<--
> }
>
>
> (the mutex is held by the caller)
>
> That should cure it and then we can think about doing it more elegantly
> by getting the serial layer to use tty_port_open, kfifo and the like and
> removing the tons of repeated crap in all the drivers.

I had to do it slightly different, see below. This patch also fixes
the garbled output and lets me run cat> and getty on the onboard 16550a,
but unlike the previous patch, I can't get a minicom connection between
the two ports using hardware flow control now, so it seems that there
is still another problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 78b1eac..cd85112 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1533,8 +1533,16 @@ static void uart_dtr_rts(struct tty_port *port, int onoff)
struct uart_state *state = container_of(port, struct uart_state, port);
struct uart_port *uport = state->uart_port;

- if (onoff)
+ if (onoff) {
uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
+
+ /*
+ * If this is the first open to succeed,
+ * adjust things to suit.
+ */
+ if (!test_and_set_bit(ASYNCB_NORMAL_ACTIVE, &port->flags))
+ uart_update_termios(port->tty, state);
+ }
else
uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
}
@@ -1649,15 +1657,6 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
if (retval == 0)
retval = tty_port_block_til_ready(port, tty, filp);

- /*
- * If this is the first open to succeed, adjust things to suit.
- */
- if (retval == 0 && !(port->flags & ASYNC_NORMAL_ACTIVE)) {
- set_bit(ASYNCB_NORMAL_ACTIVE, &port->flags);
-
- uart_update_termios(tty, state);
- }
-
fail:
return retval;
}

\
 
 \ /
  Last update: 2010-06-21 23:01    [W:0.223 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site