From owner-freebsd-usb@FreeBSD.ORG Sun Jun 18 22:33:00 2006 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B129316A479 for ; Sun, 18 Jun 2006 22:33:00 +0000 (UTC) (envelope-from gofdu-freebsd-usb@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23E5243D4C for ; Sun, 18 Jun 2006 22:32:59 +0000 (GMT) (envelope-from gofdu-freebsd-usb@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Fs5p4-0008G6-V0 for freebsd-usb@freebsd.org; Mon, 19 Jun 2006 00:32:50 +0200 Received: from h-68-164-219-99.cmbrmaor.covad.net ([68.164.219.99]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Jun 2006 00:32:50 +0200 Received: from mainland by h-68-164-219-99.cmbrmaor.covad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Jun 2006 00:32:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-usb@freebsd.org From: Geoffrey Mainland Date: Sun, 18 Jun 2006 18:32:44 -0400 Lines: 38 Message-ID: <4495D48C.2000601@apeiron.net> References: <20060616.170242.1467007423.imp@bsdimp.com> <20060617.131208.1589021232.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org Cc: freebsd-usb@freebsd.org X-Gmane-NNTP-Posting-Host: h-68-164-219-99.cmbrmaor.covad.net User-Agent: Thunderbird 1.5.0.4 (X11/20060604) In-Reply-To: <20060617.131208.1589021232.imp@bsdimp.com> X-Enigmail-Version: 0.94.0.0 Sender: news Subject: Re: ucom/uftdi dropping bytes, with debug logs FIXED X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jun 2006 22:33:00 -0000 M. Warner Losh wrote: > In message: > Geoffrey Mainland writes: > : The fact that this runs fine under VMWare makes me strongly suspect a > : timing issue that is fixed by some sort of buffering at the VMWare > : level. Where should I start to look to hack something in to test this? > : The ucom driver seems to be setting up the read transfers that don't > : complete on time. > > I'd start looking into ucom.c and uftdi.c. > > Warner Here's a diff against ucom.c version 1.57 that fixes the problem for me. I'm sure this is not the "correct" fix, but it stops bytes from being dropped :). I assume aborting the read and immediately restarting it flushes some pending data. Why is ucomstop is called so frequently by the tty code? Geoff Index: ucom.c =================================================================== --- ucom.c (revision 3) +++ ucom.c (working copy) @@ -622,10 +622,12 @@ DPRINTF(("ucomstop: %d\n", flag)); +#if 0 if ((flag & FREAD) && (sc->sc_state & UCS_RXSTOP) == 0) { DPRINTF(("ucomstop: read\n")); ucomstopread(sc); ucomstartread(sc); +#endif } if (flag & FWRITE) {