diff options
author | Alan Cox <alan@linux.intel.com> | 2009-11-05 08:27:57 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 18:18:05 -0500 |
commit | e707c35cbbe83a016cf0122a29e3a47b5a9e35c4 (patch) | |
tree | 5e0761f8e65d247f63785f5afc42623dc1291cd9 | |
parent | edfacdd6f81119b9005615593f2cbd94b8c7e2d8 (diff) |
tty_port: Move hupcl handling
Move the HUCPL handling from the end of close_port_start to the beginning
of close_port_end. What this actually does is change the ordering from
port shutdown
port->dtr_rts
to
port->dtr_rts
port shutdown
Some hardware drops the physical connection on shutdown so we must perform
the port operations before the shutdown.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/char/tty_port.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c index 41b314cfda47..dd471d63fae2 100644 --- a/drivers/char/tty_port.c +++ b/drivers/char/tty_port.c | |||
@@ -339,6 +339,14 @@ int tty_port_close_start(struct tty_port *port, | |||
339 | timeout = 2 * HZ; | 339 | timeout = 2 * HZ; |
340 | schedule_timeout_interruptible(timeout); | 340 | schedule_timeout_interruptible(timeout); |
341 | } | 341 | } |
342 | /* Flush the ldisc buffering */ | ||
343 | tty_ldisc_flush(tty); | ||
344 | |||
345 | /* Drop DTR/RTS if HUPCL is set. This causes any attached modem to | ||
346 | hang up the line */ | ||
347 | if (tty->termios->c_cflag & HUPCL) | ||
348 | tty_port_lower_dtr_rts(port); | ||
349 | |||
342 | /* Don't call port->drop for the last reference. Callers will want | 350 | /* Don't call port->drop for the last reference. Callers will want |
343 | to drop the last active reference in ->shutdown() or the tty | 351 | to drop the last active reference in ->shutdown() or the tty |
344 | shutdown path */ | 352 | shutdown path */ |
@@ -350,11 +358,6 @@ void tty_port_close_end(struct tty_port *port, struct tty_struct *tty) | |||
350 | { | 358 | { |
351 | unsigned long flags; | 359 | unsigned long flags; |
352 | 360 | ||
353 | tty_ldisc_flush(tty); | ||
354 | |||
355 | if (tty->termios->c_cflag & HUPCL) | ||
356 | tty_port_lower_dtr_rts(port); | ||
357 | |||
358 | spin_lock_irqsave(&port->lock, flags); | 361 | spin_lock_irqsave(&port->lock, flags); |
359 | tty->closing = 0; | 362 | tty->closing = 0; |
360 | 363 | ||