On Thu, Jun 6, 2013 at 5:21 PM, Xenia Ragiadakou <[email protected]> wrote:
> This patch adds a check on whether the host machine
> supports the xHC DMA address mask and sets the DMA
> mask for coherent DMA address allocation via an
> explicit call to dma_set_coherent_mask().
>
> According to DMA-API-HOWTO, if coherent DMA address
> mask has not been set explicitly via dma_set_coherent_mask(),
> and the driver calls dma_alloc_coherent() or
> dma_pool_create() to allocate consistent DMA memory
> blocks, the consistent DMA mapping interface will
> return by default DMA addresses which are 32-bit
> addressable.
>
> Hence, if 64-bit DMA mapping is supported, it
> is appropriate to call dma_set_coherent_mask()
> with DMA_BIT_MASK(64) to take advantage of it.
>
> Also, according to DMA-API-HOWTO, dma_set_coherent_mask()
> is guaranteed to set successfully the same or a smaller
> mask as dma_set_mask().

It looks for me overcomplicated.

We have *dma_mask and dma_coherent mask in the struct device.
First question, who is allocating memory for dma_mask?
Second, in case of dma_mask == NULL, dma_set_mask fails with -EIO. It
doesn't mean we have no support of this one. How do you handle this
case?

I think it's pretty simple to set dma_coherent_mask and then apply its
address to the dma_mask, because you set the same values anyway.


--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to