Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-21 Thread Benjamin Herrenschmidt
On Thu, 2012-06-21 at 07:55 -0500, Anthony Liguori wrote: > As long as we scrub the buffers, returning an unhandled error seems okay to > me. > > I've long thought we should have some sort of generic way to throw an error > and > effectively pause a single device. I'm not sure how it would wo

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-21 Thread Michael S. Tsirkin
On Thu, Jun 21, 2012 at 07:55:58AM -0500, Anthony Liguori wrote: > On 06/21/2012 02:33 AM, Michael S. Tsirkin wrote: > >On Thu, Jun 21, 2012 at 08:02:06AM +1000, Benjamin Herrenschmidt wrote: > >>On Wed, 2012-06-20 at 16:40 -0500, Anthony Liguori wrote: > >> > >>>Well let's return void in the DMA m

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-21 Thread Anthony Liguori
On 06/21/2012 02:33 AM, Michael S. Tsirkin wrote: On Thu, Jun 21, 2012 at 08:02:06AM +1000, Benjamin Herrenschmidt wrote: On Wed, 2012-06-20 at 16:40 -0500, Anthony Liguori wrote: Well let's return void in the DMA methods and let the IOMMUs assert on error. At least that will avoid surprises u

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-21 Thread Michael S. Tsirkin
On Thu, Jun 21, 2012 at 08:02:06AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2012-06-20 at 16:40 -0500, Anthony Liguori wrote: > > > Well let's return void in the DMA methods and let the IOMMUs assert on > > error. > > At least that will avoid surprises until someone decides they care enoug

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-20 Thread Gerd Hoffmann
Hi, >>> Why leave pci accessors and not implement usb_memory_rw() wrappers? >> >> Well, "usb" is a bit too generic, ehci and ohci would each need to have >> their own sets of wrappers. But yes, that's possible... is it really >> worth it ? There's nothing fundamentally wrong with using the dma_*

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-20 Thread Benjamin Herrenschmidt
On Wed, 2012-06-20 at 16:40 -0500, Anthony Liguori wrote: > Well let's return void in the DMA methods and let the IOMMUs assert on error. > At least that will avoid surprises until someone decides they care enough > about > errors to touch all callers. > > I think silently failing a memcpy() c

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-20 Thread Anthony Liguori
On 06/20/2012 04:36 PM, Benjamin Herrenschmidt wrote: Cc: Gerd Hoffmann Cc: Michael S. Tsirkin Signed-off-by: David Gibson Signed-off-by: Benjamin Herrenschmidt So... the DMA api is designed to allow for partial result returns which I presume an implementation would use as a simplification.

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-20 Thread Benjamin Herrenschmidt
> > Cc: Gerd Hoffmann > > Cc: Michael S. Tsirkin > > > > Signed-off-by: David Gibson > > Signed-off-by: Benjamin Herrenschmidt > > > So... the DMA api is designed to allow for partial result returns which I > presume an implementation would use as a simplification. > > But none of these caller

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-20 Thread Anthony Liguori
On 06/19/2012 01:39 AM, Benjamin Herrenschmidt wrote: From: David Gibson The OHCI device emulation can provide both PCI and SysBus OHCI implementations. Because of this, it was not previously converted to use the PCI DMA helper functions. This patch converts it to use the new universal DMA hel

[Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-18 Thread Benjamin Herrenschmidt
From: David Gibson The OHCI device emulation can provide both PCI and SysBus OHCI implementations. Because of this, it was not previously converted to use the PCI DMA helper functions. This patch converts it to use the new universal DMA helper functions. In the PCI case, it obtains its DMAConte

[Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-05-09 Thread Benjamin Herrenschmidt
From: David Gibson The OHCI device emulation can provide both PCI and SysBus OHCI implementations. Because of this, it was not previously converted to use the PCI DMA helper functions. This patch converts it to use the new universal DMA helper functions. In the PCI case, it obtains its DMAConte