[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] usb-xhci: Use PCI DMA helper functions
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] usb-xhci: Use PCI DMA helper functions |
Date: |
Tue, 3 Apr 2012 10:53:21 +1000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Apr 02, 2012 at 11:03:33AM +0200, Andreas Färber wrote:
> Am 02.04.2012 06:10, schrieb David Gibson:
> > Shortly before 1.0, we added helper functions / wrappers for doing PCI DMA
> > from individual devices. This makes what's going on clearer and means that
> > when we add IOMMU support somewhere in the future, only the general PCI
> > code will have to change, not every device that uses PCI DMA.
> >
> > However, usb-xhci is not using these wrappers, despite being a PCI only
> > device. This patch remedies the situation, using the pci dma functions
> > instead of direct calls to cpu_physical_memory_{read,write}(). Likewise
> > address parameters for DMA are changed to dma_addr_t instead of
> > target_phys_addr_t.
>
> 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.
>
> 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.
--
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