mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: yann.poupet@free.fr
To: linux-kernel@vger.kernel.org
Subject: PROBLEM: ppp over serial gets stuck in drivers/char/tty_ioctl.c
Date: Thu, 12 Mar 2009 11:07:35 +0100 (CET)	[thread overview]
Message-ID: <30164110.1844321236852455770.JavaMail.root@spooler2-g27.priv.proxad.net> (raw)

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.

                 reply	other threads:[~2009-03-12 10:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30164110.1844321236852455770.JavaMail.root@spooler2-g27.priv.proxad.net \
    --to=yann.poupet@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®