public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-serial@vger.kernel.org
Subject: [PATCH 3/8] serial: Add an modem status change abstraction
Date: Thu, 26 Apr 2007 13:48:22 -0500	[thread overview]
Message-ID: <20070426184822.GC25521@localdomain> (raw)

Subject: serial: Add an modem status change abstraction

Add a uart_msr_change function for reporting when modem status line
change, instead of driectly waking up the wait queue.

This is needed for a direct serial interface to be used by IPMI and a
common serial console driver (and probably other things like kgdb).
In that case, they may need to know about modem status, but since they
may be on a polled interface at panic time, a wait queue will not be
helpful.  This allows the handling of modem status for a direct serial
interface to be done in the serial core code.

Signed-off-by: Corey Minyard <minyard@acm.org>

 drivers/serial/8250.c       |    2 +-
 include/linux/serial_core.h |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

Index: linux-2.6.21/drivers/serial/8250.c
===================================================================
--- linux-2.6.21.orig/drivers/serial/8250.c
+++ linux-2.6.21/drivers/serial/8250.c
@@ -1356,7 +1356,7 @@ serial8250_handle_port(struct uart_8250_
 		uart_push(&up->port);
 
 	if (msr_ready)
-		wake_up_interruptible(&up->port.info->delta_msr_wait);
+		uart_msr_change(&up->port);
 
 	if (xmit_ready)
 		uart_write_wakeup(&up->port);
Index: linux-2.6.21/include/linux/serial_core.h
===================================================================
--- linux-2.6.21.orig/include/linux/serial_core.h
+++ linux-2.6.21/include/linux/serial_core.h
@@ -529,6 +529,12 @@ uart_push(struct uart_port *port)
 	tty_flip_buffer_push(port->info->tty);
 }
 
+static inline void
+uart_msr_change(struct uart_port *port)
+{
+	wake_up_interruptible(&port->info->delta_msr_wait);
+}
+
 /*
  *	UART_ENABLE_MS - determine if port should enable modem status irqs
  */

                 reply	other threads:[~2007-04-26 18:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070426184822.GC25521@localdomain \
    --to=minyard@acm.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-serial@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