lkml.org 
[lkml]   [2004]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2.4] serial closing_wait and close_delay used from wrong data structure
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>
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);
}
\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.338 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site