From owner-freebsd-usb@FreeBSD.ORG Wed Aug 31 22:53:11 2005 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 A184A16A41F; Wed, 31 Aug 2005 22:53:11 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe14.swipnet.se [212.247.155.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id E459143D45; Wed, 31 Aug 2005 22:53:10 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-217-132-64.daxnet.no ([193.217.132.64] verified) by mailfe14.swip.net (CommuniGate Pro SMTP 4.3.4) with ESMTP id 13974270; Thu, 01 Sep 2005 00:53:09 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Thu, 1 Sep 2005 00:54:01 +0200 User-Agent: KMail/1.7 References: <200508302009.aa99975@nowhere.iedowse.com> <200508312239.04897.hselasky@c2i.net> <43161F60.8010408@samsco.org> In-Reply-To: <43161F60.8010408@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509010054.02793.hselasky@c2i.net> Cc: Scott Long , Eugene Grosbein , Ian Dowse , freebsd-usb@freebsd.org, "Eygene A. Ryabinkin" Subject: Re: Low umass performance with USB 2.0 ports X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2005 22:53:11 -0000 On Wednesday 31 August 2005 23:21, Scott Long wrote: > >> > >>Actually, I just peeked inside the Linux EHCI code and it does a dummy > >>read immediately after writing to the status register: > >> > >> /* clear (just) interrupts */ > >> writel (status, &ehci->regs->status); > >> readl (&ehci->regs->command); /* unblock posted write */ > >> > >>I wonder if that's the whole trick here. Would someone be willing to > >>try the attached patch instead of the one that Ian posted? > >> > >>Scott > > > > This is not documented in the EHCI chip specification. > > Flushing posted writes is something that all programmers of PCI devices > should understand, so it usually isn't documented in device manuals. > > > There exists the > > doorbell to ensure that the EHCI controller is finished with data > > structures. Also I have noticed that the existing EHCI driver does not > > always dequeue structures from the controller before accessing them. > > Can you point to an example here? In the official USB system, when an endpoint is opened, a QH structure is allocated and inserted into the USB controller's schedule. After that the EHCI driver will just write new values to that structure, while it is still scheduled. In my opinion you should unqueue this structure and wait for doorbell, before touching it. > > > If Scott's patch doesn't work, could you have tried to install the > > following (compiles on FreeBSD 5/6/7): > > Yeah, looks like my guess was wrong. > > Scott --HPS