From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEs4s-0006uA-Fn for qemu-devel@nongnu.org; Mon, 02 Apr 2012 20:58:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEs4q-000280-3l for qemu-devel@nongnu.org; Mon, 02 Apr 2012 20:58:30 -0400 Received: from ozlabs.org ([203.10.76.45]:56752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEs4p-00027M-Nn for qemu-devel@nongnu.org; Mon, 02 Apr 2012 20:58:28 -0400 Date: Tue, 3 Apr 2012 10:53:21 +1000 From: David Gibson Message-ID: <20120403005321.GD7481@truffala.fritz.box> References: <1333339823-13962-1-git-send-email-david@gibson.dropbear.id.au> <1333339823-13962-3-git-send-email-david@gibson.dropbear.id.au> <4F796B65.5090502@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <4F796B65.5090502@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] usb-xhci: Use PCI DMA helper functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org, Vincent Palatin , kraxel@redhat.com, mst@redhat.com On Mon, Apr 02, 2012 at 11:03:33AM +0200, Andreas F=E4rber wrote: > Am 02.04.2012 06:10, schrieb David Gibson: > > Shortly before 1.0, we added helper functions / wrappers for doing PC= I DMA > > from individual devices. This makes what's going on clearer and mean= s that > > when we add IOMMU support somewhere in the future, only the general P= CI > > code will have to change, not every device that uses PCI DMA. > >=20 > > However, usb-xhci is not using these wrappers, despite being a PCI on= ly > > device. This patch remedies the situation, using the pci dma functio= ns > > instead of direct calls to cpu_physical_memory_{read,write}(). Likew= ise > > address parameters for DMA are changed to dma_addr_t instead of > > target_phys_addr_t. >=20 > Not related directly to this patch, Vincent Palatin had a patch to > convert the EHCI PCI device into a SysBus device (for Tegra2). I'm sure > someone at some point would want to do the equivalent for XHCI as well. >=20 > Either way, I don't think using PCI-specific data types in USB code is > going to aid in sharing code between PCI and SoC devices... Haven't > looked at that in-depth yet but would be nice to keep in mind. So, the generic DMA helpers introduced in my RFC dma/iommu series can address this - in fact the series includes a similar treatment for OHCI. So, solved problem, as far as I'm concerned. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other= _ | _way_ _around_! http://www.ozlabs.org/~dgibson