lkml.org 
[lkml]   [2004]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH][RFC] 2.6.6 tty_io.c hangup locking
From
Date
On Fri, 2004-05-28 at 15:11, Jurjen Oskam wrote:

> It was not only a warning here, but the pptp client also didn't work again
> until after rebooting. Every time the connection was retried (every 10
> seconds or so) the message appeared. Perhaps this is a problem in the pptp
> client, but after rebooting it worked.

That sounds like a different problem.
The warning itself is harmless.

I see another patch (not from me) related to closing a tty device
(also in tty_io.c) that has gone into 2.6.7-rc1
that may be related. I include that patch below


> As for the patch: applied to vanilla 2.6.5 (applied cleanly, offset -5
> lines) and compiling now.
>
> One problem though: I'm running 2.6 for about two weeks now (with a 24x7
> pptp connection), and I encountered this problem just once. I've seen a
> report that someone got this error when his connection was severed, so
> I'll try to pull the phone cable a few times and see how it recovers, both
> with and without your patch. I'll report back when I know more.


In order to see the warning, the synctty line discipline must
be waiting to push more send data to the tty device when disconnecting.
If the line is idle, then the warning will not appear on hangup.

You can try and provoke the warning in the unpatched kernel
by causing a hangup while sending lots of data.

--
Paul Fulghum
paulkf@microgate.com


diff -Nru a/drivers/char/tty_io.c b/drivers/char/tty_io.c
--- a/drivers/char/tty_io.c Sat May 22 22:55:13 2004
+++ b/drivers/char/tty_io.c Sat May 22 22:55:13 2004
@@ -1267,6 +1267,18 @@
#endif

/*
+ * Prevent flush_to_ldisc() from rescheduling the work for later. Then
+ * kill any delayed work.
+ */
+ clear_bit(TTY_DONT_FLIP, &tty->flags);
+ cancel_delayed_work(&tty->flip.work);
+
+ /*
+ * Wait for ->hangup_work and ->flip.work handlers to terminate
+ */
+ flush_scheduled_work();
+
+ /*
* Shutdown the current line discipline, and reset it to N_TTY.
* N.B. why reset ldisc when we're releasing the memory??
*/
@@ -1282,18 +1294,6 @@
module_put(o_tty->ldisc.owner);
o_tty->ldisc = ldiscs[N_TTY];
}
-
- /*
- * Prevent flush_to_ldisc() from rescheduling the work for later. Then
- * kill any delayed work.
- */
- clear_bit(TTY_DONT_FLIP, &tty->flags);
- cancel_delayed_work(&tty->flip.work);
-
- /*
- * Wait for ->hangup_work and ->flip.work handlers to terminate
- */
- flush_scheduled_work();

/*
* The release_mem function takes care of the details of clearing


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.191 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site