iommu hypervisor hypothetical

Benjamin Herrenschmidt benh at
Thu Sep 28 09:11:42 EST 2006

On Wed, 2006-09-27 at 13:25 -0500, John Rose wrote:
> > So just change the prototype of tce_build
> > to return success/failure, and handle it accordingly in iommu_alloc
> > (DMA_ERROR_CODE). The error should move on up the stack from there.
> I'm thinking of functions like dma_map_single(), which returns the
> unsigned type dma_addr_t.  Suppose H_HCE_PUT fails, and this gets
> propagated up to the device driver through DMA_ERROR_CODE.  The PAPR
> currently defines 2 ways in which this could fail, and we're considering
> at least one more.  One error code doesn't seem sufficient.

That's a design issue with the linux API that has been around for some
time. At first, there was no possible error return from dma_map_single()
in fact :( DMA_ERROR_CODE was added, and I see no way to do something
better from that function...

> > Or did I misunderstand your question in the first place? It's sort of
> > sparse on details. :-)
> You know how it goes :)  I guess my question is whether passing specific
> failure conditions up the call chain is permissible/feasible, and
> whether the prototypes for the various device driver DMA utilities are
> set in stone.
> Thanks-
> John

More information about the Linuxppc-dev mailing list