From owner-freebsd-usb@FreeBSD.ORG Sun Jun 18 23:02:14 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 BB83A16A474 for ; Sun, 18 Jun 2006 23:02:14 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E4DF43D45 for ; Sun, 18 Jun 2006 23:02:14 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [IPv6:::1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k5IN1D1h029312; Sun, 18 Jun 2006 17:01:13 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 18 Jun 2006 17:01:29 -0600 (MDT) Message-Id: <20060618.170129.1791048549.imp@bsdimp.com> To: mainland@apeiron.net From: "M. Warner Losh" In-Reply-To: <4495D48C.2000601@apeiron.net> References: <20060617.131208.1589021232.imp@bsdimp.com> <4495D48C.2000601@apeiron.net> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org 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 23:02:14 -0000 In message: <4495D48C.2000601@apeiron.net> Geoffrey Mainland writes: : 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? I don't know. Sure is weird. I've seen tip take 100% of the CPU when talking with a uftdi dongle too. Warner : 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) { : : _______________________________________________ : freebsd-usb@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-usb : To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" : :