From owner-freebsd-current@FreeBSD.ORG Wed Jun 11 20:44:11 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A3FDE37B401; Wed, 11 Jun 2003 20:44:11 -0700 (PDT) Received: from ion.gank.org (ion.gank.org [198.78.66.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1CEB43F85; Wed, 11 Jun 2003 20:44:10 -0700 (PDT) (envelope-from craig@xfoil.gank.org) Received: from localhost (ion.gank.org [198.78.66.164]) by ion.gank.org (GankMail) with ESMTP id 932742CFA9; Wed, 11 Jun 2003 22:44:09 -0500 (CDT) Received: from ion.gank.org ([198.78.66.164]) by localhost (ion.gank.org [198.78.66.164]) (amavisd-new, port 10024) with LMTP id 65180-01; Wed, 11 Jun 2003 22:44:09 -0500 (CDT) Received: from aldaris2.auir.gank.org (dsl081-113-221.dfw1.dsl.speakeasy.net [64.81.113.221]) by ion.gank.org (GankMail) with ESMTP id 32E7F2BB50; Wed, 11 Jun 2003 22:44:08 -0500 (CDT) From: Craig Boston To: ticso@cicely.de, Bernd Walter , Josef Karthauser , current@FreeBSD.org Date: Wed, 11 Jun 2003 22:44:10 -0500 User-Agent: KMail/1.5.2 References: <1055260269.91337.127.camel@owen1492.uf.corelab.com> <20030611224538.GB10822@genius.tao.org.uk> <20030612002139.GT26807@cicely12.cicely.de> In-Reply-To: <20030612002139.GT26807@cicely12.cicely.de> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_Kc/5+7lnpPHlV+x" Message-Id: <200306112244.10466.craig@xfoil.gank.org> X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: *IT WORKS* Re: CardBus USB 2.0 Controller (NEC uPD) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2003 03:44:11 -0000 --Boundary-00=_Kc/5+7lnpPHlV+x Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Believe it or not, after futzing with the debugger for hours, reading the OHCI spec, and trying to figure out why writing to the control registers works exactly as it should but the card seems to ignore the ED list, I decided to try something completely crazy and put the line pci_enable_busmaster(self); near the top of ohci_attach() in ohci_pci.c ...and it worked! I believe my first words upon seeing "ums0: " were "You have GOT to be kidding me." My logic was that since the driver allocates a DMA buffer in main memory that the card is supposed to read/write to, maybe cardbus cards have additional restrictions on what parts of system RAM they can touch and might have to use bus mastering to do it. I don't know if that's a valid assumption or not, but in any case the driver functions perfectly with every USB 1.1 and 2.0 (put the same line in ehci_pci.c) device I've tried so far. My USB 2.0 hard drive enclosure is getting around 8MB/s for reads and 7MB/s for writes. I don't know if that's good or not, or even what the physical limitations of the drive I have in there are, but it's still much improved from the ~ 800KB/s I was getting using in compatibility mode on the built-in USB port. I'm attaching a (trivial) patch for the lazy :) Be advised, this is far from a general solution as it probably breaks some (many?) PCI-based controllers that don't support bus mastering. Craig --Boundary-00=_Kc/5+7lnpPHlV+x--