mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: linux-kernel@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Russell King <rmk+lkml@arm.linux.org.uk>
Subject: [PATCH 2.4] serial closing_wait and close_delay used from wrong data structure
Date: Thu, 16 Dec 2004 13:17:52 +0000	[thread overview]
Message-ID: <41C18B00.1010009@mev.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

Hi Marcello,

Here's the split-off patch you requested.

In several drivers, the closing_wait and close_delay values are written 
to a struct serial_state by TIOCSSERIAL, but the values used in the 
close routine are read from a struct async_struct, with no code to 
transfer of values between the two structures.  This patch ignores the 
members in struct async_struct and uses the values from struct serial_state.

-- Ian.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>

[-- Attachment #2: serial-closing-wait-1.patch --]
[-- Type: text/x-patch, Size: 7233 bytes --]

diff -urN linux-2.4.29-pre1/arch/ppc/8xx_io/uart.c linux-2.4.29-pre1-ia/arch/ppc/8xx_io/uart.c
--- linux-2.4.29-pre1/arch/ppc/8xx_io/uart.c	2003-11-28 18:26:19.000000000 +0000
+++ linux-2.4.29-pre1-ia/arch/ppc/8xx_io/uart.c	2004-12-16 12:24:24.000000000 +0000
@@ -1760,8 +1760,8 @@
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	tty->closing = 1;
-	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-		tty_wait_until_sent(tty, info->closing_wait);
+	if (state->closing_wait != ASYNC_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, state->closing_wait);
 	/*
 	 * At this point we stop accepting input.  To do this, we
 	 * disable the receive line status interrupts, and tell the
@@ -1797,9 +1797,9 @@
 	info->event = 0;
 	info->tty = 0;
 	if (info->blocked_open) {
-		if (info->close_delay) {
+		if (state->close_delay) {
 			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(info->close_delay);
+			schedule_timeout(state->close_delay);
 		}
 		wake_up_interruptible(&info->open_wait);
 	}
diff -urN linux-2.4.29-pre1/arch/ppc/cpm2_io/uart.c linux-2.4.29-pre1-ia/arch/ppc/cpm2_io/uart.c
--- linux-2.4.29-pre1/arch/ppc/cpm2_io/uart.c	2004-04-14 14:05:27.000000000 +0100
+++ linux-2.4.29-pre1-ia/arch/ppc/cpm2_io/uart.c	2004-12-16 12:25:41.000000000 +0000
@@ -1754,8 +1754,8 @@
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	tty->closing = 1;
-	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-		tty_wait_until_sent(tty, info->closing_wait);
+	if (state->closing_wait != ASYNC_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, state->closing_wait);
 	/*
 	 * At this point we stop accepting input.  To do this, we
 	 * disable the receive line status interrupts, and tell the
@@ -1790,9 +1790,9 @@
 	info->event = 0;
 	info->tty = 0;
 	if (info->blocked_open) {
-		if (info->close_delay) {
+		if (state->close_delay) {
 			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(info->close_delay);
+			schedule_timeout(state->close_delay);
 		}
 		wake_up_interruptible(&info->open_wait);
 	}
diff -urN linux-2.4.29-pre1/drivers/char/amiserial.c linux-2.4.29-pre1-ia/drivers/char/amiserial.c
--- linux-2.4.29-pre1/drivers/char/amiserial.c	2002-11-28 23:53:12.000000000 +0000
+++ linux-2.4.29-pre1-ia/drivers/char/amiserial.c	2004-12-16 12:27:22.000000000 +0000
@@ -1581,8 +1581,8 @@
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	tty->closing = 1;
-	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-		tty_wait_until_sent(tty, info->closing_wait);
+	if (state->closing_wait != ASYNC_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, state->closing_wait);
 	/*
 	 * At this point we stop accepting input.  To do this, we
 	 * disable the receive line status interrupts, and tell the
@@ -1614,9 +1614,9 @@
 	info->event = 0;
 	info->tty = 0;
 	if (info->blocked_open) {
-		if (info->close_delay) {
+		if (state->close_delay) {
 			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(info->close_delay);
+			schedule_timeout(state->close_delay);
 		}
 		wake_up_interruptible(&info->open_wait);
 	}
diff -urN linux-2.4.29-pre1/drivers/char/au1x00-serial.c linux-2.4.29-pre1-ia/drivers/char/au1x00-serial.c
--- linux-2.4.29-pre1/drivers/char/au1x00-serial.c	2003-08-25 12:44:41.000000000 +0100
+++ linux-2.4.29-pre1-ia/drivers/char/au1x00-serial.c	2004-12-16 12:28:27.000000000 +0000
@@ -1948,8 +1948,8 @@
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	tty->closing = 1;
-	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-		tty_wait_until_sent(tty, info->closing_wait);
+	if (state->closing_wait != ASYNC_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, state->closing_wait);
 	/*
 	 * At this point we stop accepting input.  To do this, we
 	 * disable the receive line status interrupts, and tell the
@@ -1976,9 +1976,9 @@
 	info->event = 0;
 	info->tty = 0;
 	if (info->blocked_open) {
-		if (info->close_delay) {
+		if (state->close_delay) {
 			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(info->close_delay);
+			schedule_timeout(state->close_delay);
 		}
 		wake_up_interruptible(&info->open_wait);
 	}
diff -urN linux-2.4.29-pre1/drivers/char/serial.c linux-2.4.29-pre1-ia/drivers/char/serial.c
--- linux-2.4.29-pre1/drivers/char/serial.c	2004-11-17 11:54:21.000000000 +0000
+++ linux-2.4.29-pre1-ia/drivers/char/serial.c	2004-12-16 12:35:23.000000000 +0000
@@ -2845,8 +2845,8 @@
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	tty->closing = 1;
-	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-		tty_wait_until_sent(tty, info->closing_wait);
+	if (state->closing_wait != ASYNC_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, state->closing_wait);
 	/*
 	 * At this point we stop accepting input.  To do this, we
 	 * disable the receive line status interrupts, and tell the
@@ -2873,9 +2873,9 @@
 	info->event = 0;
 	info->tty = 0;
 	if (info->blocked_open) {
-		if (info->close_delay) {
+		if (state->close_delay) {
 			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(info->close_delay);
+			schedule_timeout(state->close_delay);
 		}
 		wake_up_interruptible(&info->open_wait);
 	}
diff -urN linux-2.4.29-pre1/drivers/char/serial_txx927.c linux-2.4.29-pre1-ia/drivers/char/serial_txx927.c
--- linux-2.4.29-pre1/drivers/char/serial_txx927.c	2002-08-03 01:39:43.000000000 +0100
+++ linux-2.4.29-pre1-ia/drivers/char/serial_txx927.c	2004-12-16 12:36:38.000000000 +0000
@@ -1442,8 +1442,8 @@
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	tty->closing = 1;
-	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-		tty_wait_until_sent(tty, info->closing_wait);
+	if (state->closing_wait != ASYNC_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, state->closing_wait);
 	/*
 	 * At this point we stop accepting input.  To do this, we
 	 * disable the receive line status interrupts, and tell the
@@ -1471,9 +1471,9 @@
 	info->event = 0;
 	info->tty = 0;
 	if (info->blocked_open) {
-		if (info->close_delay) {
+		if (state->close_delay) {
 			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(info->close_delay);
+			schedule_timeout(state->close_delay);
 		}
 		wake_up_interruptible(&info->open_wait);
 	}
diff -urN linux-2.4.29-pre1/drivers/char/vac-serial.c linux-2.4.29-pre1-ia/drivers/char/vac-serial.c
--- linux-2.4.29-pre1/drivers/char/vac-serial.c	2004-02-18 13:36:31.000000000 +0000
+++ linux-2.4.29-pre1-ia/drivers/char/vac-serial.c	2004-12-16 12:49:43.000000000 +0000
@@ -1699,8 +1699,8 @@
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	tty->closing = 1;
-	if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE)
-		tty_wait_until_sent(tty, info->closing_wait);
+	if (state->closing_wait != ASYNC_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, state->closing_wait);
 	/*
 	 * At this point we stop accepting input.  To do this, we
 	 * disable the receive line status interrupts, and tell the
@@ -1727,9 +1727,9 @@
 	info->event = 0;
 	info->tty = 0;
 	if (info->blocked_open) {
-		if (info->close_delay) {
+		if (state->close_delay) {
 			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(info->close_delay);
+			schedule_timeout(state->close_delay);
 		}
 		wake_up_interruptible(&info->open_wait);
 	}

                 reply	other threads:[~2004-12-16 13:23 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=41C18B00.1010009@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=rmk+lkml@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

all inboxes | Powered by JetHome®