All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@nokia.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: alan@lxorguk.ukuu.org.uk, dbrownell@users.sourceforge.net
Subject: TTY loosing bytes ?
Date: Tue, 6 Oct 2009 12:48:45 +0300	[thread overview]
Message-ID: <20091006094845.GT4452@nokia.com> (raw)

Hi all,

I'm facing a weird issue with TTY when using u_serial gadget.

The problem seems to be related to ldisc's buffer getting full. Imagine
a situation where you have 510 bytes available on N_TTY's buffer and you
try to flush 512 bytes then the code path would look like:

--> flush_to_ldisc();
	--> n_tty_receive_buf(512 bytes);
		--> i = 510;
		--> memcpy(i);

		--> i = 0;
		--> memcpy(i);
	<-- wake_up_interruptible();

What happens is that we loose those 2 extra bytes. I tried digging this
problem and try to find a fix for it but it's been really complicated
for me.

Hope you guys can help. Actually, I've been reproducing the problem on
2.6.28 but looking at the code current mainline should have the same
problem. I also cherry-picked the relevant patches to my 2.6.28 tree
(hope I got all of them) and it still failed.

Sorry I'm reporting such a problem with such an old kernel but upgrading
the kernel right now is just impossible.

If you guys could give any pointers I would be really glad.

-- 
balbi

             reply	other threads:[~2009-10-06  9:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-06  9:48 Felipe Balbi [this message]
2009-10-06 11:45 ` TTY loosing bytes ? Felipe Balbi
2009-10-06 12:12   ` Alan Cox
2009-10-06 13:01     ` Felipe Balbi
2009-10-06 13:11       ` Alan Cox
2009-10-06 13:27         ` Felipe Balbi
2009-10-06 13:40           ` Alan Cox
2009-10-06 13:42             ` Felipe Balbi
2009-10-06 13:55               ` Felipe Balbi

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=20091006094845.GT4452@nokia.com \
    --to=felipe.balbi@nokia.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dbrownell@users.sourceforge.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.