Messages in this thread | | | Date | Thu, 12 Mar 2009 11:07:35 +0100 (CET) | From | yann.poupet@free ... | Subject | PROBLEM: ppp over serial gets stuck in drivers/char/tty_ioctl.c |
| |
Hello,
I'm working on ARM with kernel 2.6.18.2, and maybe I found a problem in drivers/char/tty_ioctl.c, function tty_wait_until_sent().
void tty_wait_until_sent(struct tty_struct * tty, long timeout) { DECLARE_WAITQUEUE(wait, current);
#ifdef TTY_DEBUG_WAIT_UNTIL_SENT char buf[64];
printk(KERN_DEBUG "%s wait until sent...\n", tty_name(tty, buf)); #endif if (!tty->driver->chars_in_buffer) return; add_wait_queue(&tty->write_wait, &wait); [snip...]
While trying to get PPP to work over serial line, I found ppp getting stuck in this function, because if tty buffer is empty when getting here, it might wait forever IIRC (I found the problem a few month ago and can't remember the details of my investigations). This is why I added a test to see whether the buffer is not already empty:
[snip...] if (!tty->driver->chars_in_buffer) return; /* if buffer is empty, return */ if (!tty->driver->chars_in_buffer(tty)) return; add_wait_queue(&tty->write_wait, &wait); [snip...]
After this modification, ppp over serial line worked fine.
Is it on purpose one tests whether tty->driver->chars_in_buffer is != 0 ? I felt like this should be if (!tty->driver->chars_in_buffer(tty)), but in doubts I left both tests.
I saw tty_wait_until_sent() has been modified between 2.6.25 and 2.6.26, so probably this problem is gone in newer kernels. However, if a kernel version up to 2.6.25 is still maintained, or if someone gets the same problem for kernel up to 2.6.25, this might be usefull.
Since this is only related to older kernel, maybe I shouldn't post to this ML, but I haven't found where I should send my message.
Regards,
Yann Poupet.
| |