Messages in this thread | | | Date | Mon, 24 Nov 2008 14:21:28 +0000 | From | Alan Cox <> | Subject | Re: [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
| |