lkml.org 
[lkml]   [2011]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: TTY loosing data with u_serial gadget
Can you try this:
> diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
> index 2f119e2..f0b9fb6 100644
> --- a/drivers/tty/tty_buffer.c
> +++ b/drivers/tty/tty_buffer.c

I tried it and the console is working again.
There is still an problem on heavy load transfer from host to gadget.
I attached the patch to fix also this problem.

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 8e0f113..95d0a9c 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1359,6 +1359,7 @@ static unsigned int n_tty_receive_buf(struct
tty_struct *tty,
memcpy(tty->read_buf + tty->read_head, cp, i);
tty->read_head = (tty->read_head + i) & (N_TTY_BUF_SIZE-1);
tty->read_cnt += i;
+ ret += i;
spin_unlock_irqrestore(&tty->read_lock, cpuflags);
} else {
ret = count;
With this patch I was able to transfer gigabytes without lost data.



\
 
 \ /
  Last update: 2011-03-24 16:51    [W:0.062 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site