Thread (5 messages) 5 messages, 4 authors, 2010-08-12

[PATCH] ARM: add PrimeCell generic DMA to MMCI/PL180 v10

flat view
STALE5915d

From: Russell King - ARM Linux <hidden>
Date: 2010-08-12 14:30:02

On Thu, Aug 12, 2010 at 03:58:08PM +0200, Linus Walleij wrote:
2010/8/11 Rabin Vincent [off-list ref]:
quoted
quoted
+ ? ? sglen = dma_map_sg(mmc_dev(host->mmc), data->sg,
+ ? ? ? ? ? ? ? ? ? ? ? ?data->sg_len, direction);
+ ? ? if (sglen != data->sg_len)
+ ? ? ? ? ? ? goto unmap_exit;
sglen < data->sg_len is not an error condition.
In arch/arm/mm/dma-mapping.c
dma_map_sg() returns 0 on a mapping error, and the same as
passed in the third parameter on success.
Rabin is right - dma_map_sg() is allowed to return fewer entries than
was passed as it is allowed to coalesce entries together.  Please don't
use the implementation as a source of how things should behave, instead
read the documentation in Documentation/DMA-API.txt:

        int
        dma_map_sg(struct device *dev, struct scatterlist *sg,
                int nents, enum dma_data_direction direction)

Returns: the number of physical segments mapped (this may be shorter
than <nents> passed in if some elements of the scatter/gather list are
physically or virtually adjacent and an IOMMU maps them with a single
entry).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help