summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby2011-08-17 13:48:15 +0200
committerGreg Kroah-Hartman2011-08-23 19:10:38 +0200
commit0055197e984e5fbe6f48f37fc50dd30254915493 (patch)
treedf7de31cd63bc231a37fd6833ba53e40140ceff5
parentTTY: pty, fix pty counting (diff)
downloadkernel-qcow2-linux-0055197e984e5fbe6f48f37fc50dd30254915493.tar.gz
kernel-qcow2-linux-0055197e984e5fbe6f48f37fc50dd30254915493.tar.xz
kernel-qcow2-linux-0055197e984e5fbe6f48f37fc50dd30254915493.zip
TTY: serial, document ignoring of uart->ops->startup error
When a user has SYS_ADMIN capabilities and uart->ops->startup returns an error in uart_startup, we silently drop the error. We then return 0 and behave as if it didn't fail. (Not quite, since we set TTY_IO_ERROR bit and leave ASYNC_INITIALIZED bit cleared.) This all is to allow setserial to work with improperly configured or unconfigured ports. User can thus set port properties and reconfigure properly. This patch only documents this behavior. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Russel King <linux@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/tty/serial/serial_core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index db7912cb7ae0..a3efbea5dbba 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -200,6 +200,11 @@ static int uart_startup(struct tty_struct *tty, struct uart_state *state, int in
clear_bit(TTY_IO_ERROR, &tty->flags);
}
+ /*
+ * This is to allow setserial on this port. People may want to set
+ * port/irq/type and then reconfigure the port properly if it failed
+ * now.
+ */
if (retval && capable(CAP_SYS_ADMIN))
retval = 0;