linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-serial@vger.kernel.org
Cc: Jiri Slaby <jslaby@suse.cz>, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Russel King <linux@arm.linux.org.uk>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 11/12] TTY: serial, document ignoring of uart->ops->startup error
Date: Fri, 26 Aug 2011 13:58:20 -0700	[thread overview]
Message-ID: <1314392301-25140-11-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1314392301-25140-1-git-send-email-gregkh@suse.de>

From: Jiri Slaby <jslaby@suse.cz>

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>
---
 drivers/tty/serial/serial_core.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index db7912c..a3efbea 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;
 
-- 
1.7.6.1


  parent reply	other threads:[~2011-08-26 20:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26 19:11 [GIT PATCH] TTY/serial driver fixes for 3.1 Greg KH
2011-08-26 20:58 ` [PATCH 01/12] serial: samsung: Fix build error Greg Kroah-Hartman
2011-08-26 20:58   ` [PATCH 02/12] pch_uart: Set PCIe bus number using probe parameter Greg Kroah-Hartman
2011-08-26 20:58   ` [PATCH 03/12] drivers/serial/ucc_uart.c: Fix compiler warning Greg Kroah-Hartman
2011-08-26 20:58   ` [PATCH 04/12] serial: 8250_pnp: add Intermec CV60 touchscreen device Greg Kroah-Hartman
2011-08-26 20:58   ` [PATCH 05/12] atmel_serial: fix atmel_default_console_device Greg Kroah-Hartman
2011-08-26 20:58   ` [PATCH 06/12] tty: Add "spi:" prefix for spi modalias Greg Kroah-Hartman
2011-08-26 20:58   ` [PATCH 07/12] 8250_pci: add support for Rosewill RC-305 4x serial port card Greg Kroah-Hartman
2011-08-26 20:58   ` [PATCH 08/12] serial/8250_pci: delete duplicate data definition Greg Kroah-Hartman
2011-08-26 20:58   ` [PATCH 09/12] 8250: Fix race condition in serial8250_backup_timeout() Greg Kroah-Hartman
2011-08-26 20:58   ` [PATCH 10/12] TTY: pty, fix pty counting Greg Kroah-Hartman
2011-08-26 20:58   ` Greg Kroah-Hartman [this message]
2011-08-26 20:58   ` [PATCH 12/12] omap-serial: Allow IXON and IXOFF to be disabled Greg Kroah-Hartman

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=1314392301-25140-11-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jslaby@suse.cz \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).