Re: [PATCH V2 2/3] powerpc: Add support for swiotlb on 32-bit

From: FUJITA Tomonori
Date: Fri May 22 2009 - 06:52:35 EST


On Thu, 21 May 2009 20:01:37 +0100
Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx> wrote:

> > It's not actually clear to me that we need that check, though. Can
> > someone explain what case that was designed to catch?
>
> If map_single fails and returns NULL then we try to use
> io_tlb_overflow_buffer, if that is somehow not DMA-able (for the
> particular device) then the check will trigger. I would have thought we
> could arrange that the overflow buffer is always OK and really if
> map_page is failing we must be close the edge already.

And iotlb buffers are not guaranteed to be DMA-capable; it's possible
that some drivers (with poor dma address restrictions) can't handle
some part of iotlb buffers.

So after allocating some ioblb buffer, we need to check if the buffers
are DMA-capable for a driver. Well, it's unlikely though.

Well, it would be better to move the check to map_single().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/