aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Fulghum <paulkf@microgate.com>2006-02-10 04:51:14 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-10 11:13:12 -0500
commit8977d929e49021d9a6e031310aab01fa72f849c2 (patch)
tree13697e607b1153666139114242964f9982acc328 /include
parentf0188f47482efdbd2e005103bb4f0224a835dfad (diff)
[PATCH] tty buffering stall fix
Prevent stalled processing of received data when a driver allocates tty buffer space but does not immediately follow the allocation with more data and a call to schedule receive tty processing. (example: hvc_console) This bug was introduced by the first locking patch for the new tty buffering. Signed-off-by: Paul Fulghum <paulkf@microgate.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kbd_kern.h4
-rw-r--r--include/linux/tty.h2
-rw-r--r--include/linux/tty_flip.h4
3 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index 3aed37314ab8..e87c32a5c86a 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -153,8 +153,10 @@ static inline void con_schedule_flip(struct tty_struct *t)
153{ 153{
154 unsigned long flags; 154 unsigned long flags;
155 spin_lock_irqsave(&t->buf.lock, flags); 155 spin_lock_irqsave(&t->buf.lock, flags);
156 if (t->buf.tail != NULL) 156 if (t->buf.tail != NULL) {
157 t->buf.tail->active = 0; 157 t->buf.tail->active = 0;
158 t->buf.tail->commit = t->buf.tail->used;
159 }
158 spin_unlock_irqrestore(&t->buf.lock, flags); 160 spin_unlock_irqrestore(&t->buf.lock, flags);
159 schedule_work(&t->buf.work); 161 schedule_work(&t->buf.work);
160} 162}
diff --git a/include/linux/tty.h b/include/linux/tty.h
index a7bd3b4558d2..f45cd74e6f24 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -58,6 +58,8 @@ struct tty_buffer {
58 int used; 58 int used;
59 int size; 59 int size;
60 int active; 60 int active;
61 int commit;
62 int read;
61 /* Data points here */ 63 /* Data points here */
62 unsigned long data[0]; 64 unsigned long data[0];
63}; 65};
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 82961eb19888..222faf97d5f9 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -29,8 +29,10 @@ _INLINE_ void tty_schedule_flip(struct tty_struct *tty)
29{ 29{
30 unsigned long flags; 30 unsigned long flags;
31 spin_lock_irqsave(&tty->buf.lock, flags); 31 spin_lock_irqsave(&tty->buf.lock, flags);
32 if (tty->buf.tail != NULL) 32 if (tty->buf.tail != NULL) {
33 tty->buf.tail->active = 0; 33 tty->buf.tail->active = 0;
34 tty->buf.tail->commit = tty->buf.tail->used;
35 }
34 spin_unlock_irqrestore(&tty->buf.lock, flags); 36 spin_unlock_irqrestore(&tty->buf.lock, flags);
35 schedule_delayed_work(&tty->buf.work, 1); 37 schedule_delayed_work(&tty->buf.work, 1);
36} 38}