From: Alan Cox <alan@linux.intel.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 01/14] tty: serial - fix tty referencing in set_ldisc
Date: Thu, 01 Apr 2010 17:04:18 +0100 [thread overview]
Message-ID: <20100401160414.8882.51526.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100401155513.8882.54006.stgit@localhost.localdomain>
Pass down the ldisc number so that the drivers don't have to peek into the
tty object themselves. This lets us get rid of another case of back referencing
port to tty which we don't want (because of races versus hangup/close).
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/serial/bfin_5xx.c | 7 ++-----
drivers/serial/serial_core.c | 2 +-
include/linux/serial_core.h | 2 +-
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 96f7e74..e0d25ca 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -952,15 +952,12 @@ bfin_serial_verify_port(struct uart_port *port, struct serial_struct *ser)
* Enable the IrDA function if tty->ldisc.num is N_IRDA.
* In other cases, disable IrDA function.
*/
-static void bfin_serial_set_ldisc(struct uart_port *port)
+static void bfin_serial_set_ldisc(struct uart_port *port, int ld)
{
int line = port->line;
unsigned short val;
- if (line >= port->state->port.tty->driver->num)
- return;
-
- switch (port->state->port.tty->termios->c_line) {
+ switch (ld) {
case N_IRDA:
val = UART_GET_GCTL(&bfin_serial_ports[line]);
val |= (IREN | RPOLC);
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 7f28307..686ff6c 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1194,7 +1194,7 @@ static void uart_set_ldisc(struct tty_struct *tty)
struct uart_port *uport = state->uart_port;
if (uport->ops->set_ldisc)
- uport->ops->set_ldisc(uport);
+ uport->ops->set_ldisc(uport, tty->termios->c_line);
}
static void uart_set_termios(struct tty_struct *tty,
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index ad83996..5c4cbe6 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -216,7 +216,7 @@ struct uart_ops {
void (*flush_buffer)(struct uart_port *);
void (*set_termios)(struct uart_port *, struct ktermios *new,
struct ktermios *old);
- void (*set_ldisc)(struct uart_port *);
+ void (*set_ldisc)(struct uart_port *, int new);
void (*pm)(struct uart_port *, unsigned int state,
unsigned int oldstate);
int (*set_wake)(struct uart_port *, unsigned int state);
next prev parent reply other threads:[~2010-04-01 16:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-01 16:04 [RFC PATCH 00/14] Some BKL killing in the serial drivers Alan Cox
2010-04-01 16:04 ` Alan Cox [this message]
2010-04-01 16:04 ` [PATCH 02/14] tty: serial - fix tty back references in termios Alan Cox
2010-04-01 16:04 ` [PATCH 03/14] tty: serial - fix various misuses/mishandlings of port->tty Alan Cox
2010-04-01 16:04 ` [PATCH 04/14] vc: Locking clean up Alan Cox
2010-04-30 20:30 ` Arnd Bergmann
2010-04-01 16:05 ` [PATCH 05/14] stallion: prune lock_kernel calls Alan Cox
2010-04-29 21:29 ` Arnd Bergmann
2010-04-30 19:32 ` Alan Cox
2010-04-01 16:05 ` [PATCH 06/14] istallion: use bit ops for the board flags Alan Cox
2010-04-01 16:05 ` [PATCH 07/14] riscom8: kill use of lock_kernel Alan Cox
2010-04-01 16:05 ` [PATCH 08/14] isicom: kill off the BKL Alan Cox
2010-04-01 16:06 ` [PATCH 09/14] rocket: kill BKL Alan Cox
2010-04-01 16:06 ` [PATCH 10/14] synclink: kill the big kernel lock Alan Cox
2010-04-01 16:06 ` [PATCH 11/14] cyclades: Kill off BKL usage Alan Cox
2010-04-01 16:06 ` [PATCH 12/14] epca: Kill the big kernel lock Alan Cox
2010-04-01 16:07 ` [PATCH 13/14] specialix; Kill the BKL Alan Cox
2010-04-01 16:07 ` [PATCH 14/14] synclink: reworking locking a bit 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=20100401160414.8882.51526.stgit@localhost.localdomain \
--to=alan@linux.intel.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