From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 1 08:44:31 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02DB516A41F; Thu, 1 Sep 2005 08:44:31 +0000 (GMT) (envelope-from freebsd@rea.mbslab.kiae.ru) Received: from rea.mbslab.kiae.ru (rea.mbslab.kiae.ru [144.206.177.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81B3543D46; Thu, 1 Sep 2005 08:44:30 +0000 (GMT) (envelope-from freebsd@rea.mbslab.kiae.ru) Received: from rea.mbslab.kiae.ru (localhost [127.0.0.1]) by rea.mbslab.kiae.ru (Postfix) with ESMTP id 17CC5BD6D; Thu, 1 Sep 2005 12:44:22 +0400 (MSD) Received: by rea.mbslab.kiae.ru (Postfix, from userid 1000) id DE3E5BD6C; Thu, 1 Sep 2005 12:44:21 +0400 (MSD) Date: Thu, 1 Sep 2005 12:44:21 +0400 From: "Eygene A. Ryabinkin" To: Scott Long Message-ID: <20050901084421.GA840@rea.mbslab.kiae.ru> References: <200508302009.aa99975@nowhere.iedowse.com> <43160334.5000100@samsco.org> <43160943.6030400@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <43160943.6030400@samsco.org> User-Agent: Mutt/1.5.9i X-AV-Checked: Yes! Cc: Ian Dowse , hackers@freebsd.org, Eugene Grosbein , freebsd-usb@freebsd.org Subject: Re: Low umass performance with USB 2.0 ports X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2005 08:44:31 -0000 > 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? Yes, that solved my problem. But the patch (for 5.x) uses different line numbers: ----- --- /sys/dev/usb/ehci.c.orig Thu Sep 1 10:59:51 2005 +++ /sys/dev/usb/ehci.c Thu Sep 1 10:48:59 2005 @@ -580,6 +580,7 @@ return (0); EOWRITE4(sc, EHCI_USBSTS, intrs); /* Acknowledge */ + EOREAD4(sc, EHCI_USBCMD); /* Flush posted writes on PCI */ sc->sc_bus.intr_context++; sc->sc_bus.no_intrs++; if (eintrs & EHCI_STS_IAA) { ----- Apart from this the patch works: the writing process still spends much time in the wdrain state, but no stalls occurs. Just a remark: my USB 2.0 controller chip is made by NEC, not VIA. For a FAT curiosity: FAT 32 gives 700K/sec and FAT 16 -- 3 Mb/sec. -- rea