Displaying 5 results from an estimated 5 matches for "dma_is_direct".
2019 Oct 14
3
[PATCH 1/2] dma-mapping: Add dma_addr_is_phys_addr()
On Fri, Oct 11, 2019 at 06:25:18PM -0700, Ram Pai wrote:
> From: Thiago Jung Bauermann <bauerman at linux.ibm.com>
>
> In order to safely use the DMA API, virtio needs to know whether DMA
> addresses are in fact physical addresses and for that purpose,
> dma_addr_is_phys_addr() is introduced.
>
> cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> cc:
2019 Oct 14
3
[PATCH 1/2] dma-mapping: Add dma_addr_is_phys_addr()
On Fri, Oct 11, 2019 at 06:25:18PM -0700, Ram Pai wrote:
> From: Thiago Jung Bauermann <bauerman at linux.ibm.com>
>
> In order to safely use the DMA API, virtio needs to know whether DMA
> addresses are in fact physical addresses and for that purpose,
> dma_addr_is_phys_addr() is introduced.
>
> cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> cc:
2019 Feb 07
0
[PATCH v7 3/5] dma: Introduce dma_max_mapping_size()
...3 +357,17 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
ops->cache_sync(dev, vaddr, size, dir);
}
EXPORT_SYMBOL(dma_cache_sync);
+
+size_t dma_max_mapping_size(struct device *dev)
+{
+ const struct dma_map_ops *ops = get_dma_ops(dev);
+ size_t size = SIZE_MAX;
+
+ if (dma_is_direct(ops))
+ size = dma_direct_max_mapping_size(dev);
+ else if (ops && ops->max_mapping_size)
+ size = ops->max_mapping_size(dev);
+
+ return size;
+}
+EXPORT_SYMBOL_GPL(dma_max_mapping_size);
--
2.17.1
2019 Oct 14
0
[PATCH 1/2] dma-mapping: Add dma_addr_is_phys_addr()
...cal address" is true of various IOMMU setups too, but I
can't believe it's meaningful in such cases.
If what you actually want is "DMA is direct or SWIOTLB" - i.e. "DMA
address is physical address of DMA data (not necessarily the original
buffer)" - wouldn't dma_is_direct() suffice?
Robin.
>> ---
>> arch/powerpc/include/asm/dma-mapping.h | 21 +++++++++++++++++++++
>> arch/powerpc/platforms/pseries/Kconfig | 1 +
>> include/linux/dma-mapping.h | 20 ++++++++++++++++++++
>> kernel/dma/Kconfig | 3 +...
2019 Feb 07
5
[PATCH v7 0/5] Fix virtio-blk issue with SWIOTLB
Hi,
here is the next version of this patch-set. Previous
versions can be found here:
V1: https://lore.kernel.org/lkml/20190110134433.15672-1-joro at 8bytes.org/
V2: https://lore.kernel.org/lkml/20190115132257.6426-1-joro at 8bytes.org/
V3: https://lore.kernel.org/lkml/20190123163049.24863-1-joro at 8bytes.org/
V4: https://lore.kernel.org/lkml/20190129084342.26030-1-joro at 8bytes.org/