summaryrefslogtreecommitdiffstats
path: root/drivers/tty/mxser.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-10 17:51:38 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-28 17:19:12 -0500
commitcd7b4b3944381713038d39240098908ffeec647d (patch)
treeda77e4ff39194f6d19d600e16f62451c2f806be7 /drivers/tty/mxser.c
parentb4749b97ae41f02775967bd109a15b2e223f86be (diff)
tty: mxser: Remove ASYNC_CLOSING
The tty core no longer provides ASYNC_CLOSING. Use private flag for same purpose, which is to clear the fifos at each and every interrupt during driver close(). The driver uses this sledgehammer approach because its close/shutdown sequence is hopelessly borked. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/mxser.c')
-rw-r--r--drivers/tty/mxser.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index e9600cece8da..9a0791e523b5 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -254,6 +254,7 @@ struct mxser_port {
254 int xmit_head; 254 int xmit_head;
255 int xmit_tail; 255 int xmit_tail;
256 int xmit_cnt; 256 int xmit_cnt;
257 int closing;
257 258
258 struct ktermios normal_termios; 259 struct ktermios normal_termios;
259 260
@@ -1081,6 +1082,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
1081 return; 1082 return;
1082 if (tty_port_close_start(port, tty, filp) == 0) 1083 if (tty_port_close_start(port, tty, filp) == 0)
1083 return; 1084 return;
1085 info->closing = 1;
1084 mutex_lock(&port->mutex); 1086 mutex_lock(&port->mutex);
1085 mxser_close_port(port); 1087 mxser_close_port(port);
1086 mxser_flush_buffer(tty); 1088 mxser_flush_buffer(tty);
@@ -1091,6 +1093,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
1091 mxser_shutdown_port(port); 1093 mxser_shutdown_port(port);
1092 clear_bit(ASYNCB_INITIALIZED, &port->flags); 1094 clear_bit(ASYNCB_INITIALIZED, &port->flags);
1093 mutex_unlock(&port->mutex); 1095 mutex_unlock(&port->mutex);
1096 info->closing = 0;
1094 /* Right now the tty_port set is done outside of the close_end helper 1097 /* Right now the tty_port set is done outside of the close_end helper
1095 as we don't yet have everyone using refcounts */ 1098 as we don't yet have everyone using refcounts */
1096 tty_port_close_end(port, tty); 1099 tty_port_close_end(port, tty);
@@ -2253,10 +2256,8 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id)
2253 break; 2256 break;
2254 iir &= MOXA_MUST_IIR_MASK; 2257 iir &= MOXA_MUST_IIR_MASK;
2255 tty = tty_port_tty_get(&port->port); 2258 tty = tty_port_tty_get(&port->port);
2256 if (!tty || 2259 if (!tty || port->closing ||
2257 (port->port.flags & ASYNC_CLOSING) || 2260 !(port->port.flags & ASYNC_INITIALIZED)) {
2258 !(port->port.flags &
2259 ASYNC_INITIALIZED)) {
2260 status = inb(port->ioaddr + UART_LSR); 2261 status = inb(port->ioaddr + UART_LSR);
2261 outb(0x27, port->ioaddr + UART_FCR); 2262 outb(0x27, port->ioaddr + UART_FCR);
2262 inb(port->ioaddr + UART_MSR); 2263 inb(port->ioaddr + UART_MSR);