Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Sep 2005 12:44:21 +0400
From:      "Eygene A. Ryabinkin" <freebsd@rea.mbslab.kiae.ru>
To:        Scott Long <scottl@samsco.org>
Cc:        Ian Dowse <iedowse@iedowse.com>, hackers@freebsd.org, Eugene Grosbein <eugen@kuzbass.ru>, freebsd-usb@freebsd.org
Subject:   Re: Low umass performance with USB 2.0 ports
Message-ID:  <20050901084421.GA840@rea.mbslab.kiae.ru>
In-Reply-To: <43160943.6030400@samsco.org>
References:  <200508302009.aa99975@nowhere.iedowse.com> <43160334.5000100@samsco.org> <43160943.6030400@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050901084421.GA840>