lkml.org 
[lkml]   [2008]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty: Fix async io write notifications
On Mon, 24 Nov 2008 14:40:15 +0100 (CET)
Thomas Pfaff <tpfaff@pcs.com> wrote:

> he N_TTY ldisc layer does not send SIGIO POLL_OUTs correctly when output is
> possible due to flawed handling of the TTY_DO_WRITE_WAKEUP bit. It will either
> send no SIGIOs at all or on every tty wakeup.
>
> The fix is to set the bit when the tty driver write would block and test and
> clear it on write wakeup.
>
> Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>

I had done a patch already but yours is somewhat nicer so I've merged
yours instead with some tweaks as it clashed with an existing N_TTY patch

I left the tty->fasync check in the if (in case the user clears async I/O
events) and I reversed the tests on the end of n_tty_write simply
because the compiler has the variables we need to check to hand but not
tty->fasync.

This all looks good to me. It breaks on ptys but that is another bug and
I'll merge a patch to fix the ptys next.

Alan


\
 
 \ /
  Last update: 2008-11-24 15:25    [W:0.032 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site