From: David Gibson <david@gibson.dropbear.id.au>
To: "Andreas Färber" <afaerber@suse.de>
Cc: qemu-devel@nongnu.org, Vincent Palatin <vpalatin@chromium.org>,
kraxel@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/2] usb-xhci: Use PCI DMA helper functions
Date: Tue, 3 Apr 2012 10:53:21 +1000 [thread overview]
Message-ID: <20120403005321.GD7481@truffala.fritz.box> (raw)
In-Reply-To: <4F796B65.5090502@suse.de>
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
next prev parent reply other threads:[~2012-04-03 0:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 4:10 [Qemu-devel] [0/2] Convert usb-xhci to use PCI DMA helpers David Gibson
2012-04-02 4:10 ` [Qemu-devel] [PATCH 1/2] Better support for dma_addr_t variables David Gibson
2012-04-02 4:10 ` [Qemu-devel] [PATCH 2/2] usb-xhci: Use PCI DMA helper functions David Gibson
2012-04-02 9:03 ` Andreas Färber
2012-04-03 0:53 ` David Gibson [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-04-04 0:15 [Qemu-devel] [PATCH 0/2] Preliminaries for DMA/IOMMU support David Gibson
2012-04-04 0:15 ` [Qemu-devel] [PATCH 2/2] usb-xhci: Use PCI DMA helper functions David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120403005321.GD7481@truffala.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=afaerber@suse.de \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vpalatin@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).