Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933430Ab1CXQPL (ORCPT ); Thu, 24 Mar 2011 12:15:11 -0400 Received: from realvnc.com ([146.101.152.142]:41894 "EHLO realvnc.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932203Ab1CXQPF (ORCPT ); Thu, 24 Mar 2011 12:15:05 -0400 Message-ID: <4D8B6E06.2060506@realvnc.com> Date: Thu, 24 Mar 2011 16:15:02 +0000 From: Toby Gray User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: stefan.bigler@keymile.com CC: balbi@ti.com, Alan Cox , Greg KH , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: TTY loosing data with u_serial gadget References: <4D8121F6.9060600@keymile.com><20110317000408.GA18911@kroah.com><4D8389EC.5030704@keymile.com><20110318170801.GA2857@legolas.emea.dhcp.ti.com><20110318180657.11570887@lxorguk.ukuu.org.uk><20110321093255.GE1837@legolas.emea.dhcp.ti.com><20110322085344.GN1837@legolas.emea.dhcp.ti.com><4D8B341C.4010406@realvnc.com><20110324123708.GK14602@legolas.emea.dhcp.ti.com><4D8B3E61.1090704@realvnc.com> <20110324130006.GM14602@legolas.emea.dhcp.ti.com> <4D8B65F4.40306@keymile.com> In-Reply-To: <4D8B65F4.40306@keymile.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1479 Lines: 41 On 24/03/2011 15:40, Stefan Bigler wrote: > 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. I can confirm that this combined with the last two patches from Felipe Balbi fix all the issues I've had as well and seems stable and without loss under fast data transfers. Regards, Toby -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/