From: Alan Cox <alan@linux.intel.com>
To: greg@kroah.com, linux-kernel@vger.kernel.org
Subject: [PATCH 4/7] tty_port: Add IO_ERROR bit handling
Date: Wed, 18 Nov 2009 14:10:31 +0000 [thread overview]
Message-ID: <20091118141027.2798.51296.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091118140935.2798.32517.stgit@localhost.localdomain>
To propogate tty_port_open/close to a few other devices we need to start
handling the IO_ERROR flag on the tty. We can do this pretty trivially.
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/char/tty_port.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index 8825255..beaf599 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -122,8 +122,10 @@ void tty_port_hangup(struct tty_port *port)
spin_lock_irqsave(&port->lock, flags);
port->count = 0;
port->flags &= ~ASYNC_NORMAL_ACTIVE;
- if (port->tty)
+ if (port->tty) {
+ set_bit(TTY_IO_ERROR, &port->tty->flags);
tty_kref_put(port->tty);
+ }
port->tty = NULL;
spin_unlock_irqrestore(&port->lock, flags);
wake_up_interruptible(&port->open_wait);
@@ -377,6 +379,7 @@ void tty_port_close(struct tty_port *port, struct tty_struct *tty,
if (tty_port_close_start(port, tty, filp) == 0)
return;
tty_port_shutdown(port);
+ set_bit(TTY_IO_ERROR, &tty->flags);
tty_port_close_end(port, tty);
tty_port_tty_set(port, NULL);
}
@@ -408,6 +411,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
}
}
set_bit(ASYNCB_INITIALIZED, &port->flags);
+ clear_bit(TTY_IO_ERROR, &tty->flags);
}
mutex_unlock(&port->mutex);
return tty_port_block_til_ready(port, tty, filp);
next prev parent reply other threads:[~2009-11-18 14:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-18 14:09 [PATCH 0/7] more beating of serial in the direction of sanity Alan Cox
2009-11-18 14:10 ` [PATCH 1/7] tty_port: Change the buffer allocator locking Alan Cox
2009-11-18 14:10 ` [PATCH 2/7] n_tty: fix throttling Alan Cox
2009-11-18 14:10 ` [PATCH 3/7] riscom8: switch to the tty_port_open API Alan Cox
2009-11-18 14:10 ` Alan Cox [this message]
2009-11-18 14:10 ` [PATCH 5/7] tty_port: Move the IO_ERROR clear Alan Cox
2009-11-18 14:10 ` [PATCH 6/7] stallion: Convert to the tty_port_open/close methods Alan Cox
2009-11-18 14:10 ` [PATCH 7/7] istallion: tty port open/close methods Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091118141027.2798.51296.stgit@localhost.localdomain \
--to=alan@linux.intel.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox