Skip to content

Commit

Permalink
ARM/dma-mapping: use dma-direct unconditionally
Browse files Browse the repository at this point in the history
Use dma-direct unconditionally on arm.  It has already been used for
some time for LPAE and nommu configurations.

This mostly changes the streaming mapping implementation and the (simple)
coherent allocator for device that are DMA coherent.  The existing
complex allocator for uncached mappings for non-coherent devices is still
used as is using the arch_dma_alloc/arch_dma_free hooks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Andre Przywara <andre.przywara@arm.com> [highbank]
Tested-by: Marc Zyngier <maz@kernel.org>
  • Loading branch information
Christoph Hellwig committed Jul 7, 2022
1 parent af6f23b commit ae626eb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 378 deletions.
4 changes: 2 additions & 2 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ config ARM
select ARCH_HAS_SET_MEMORY
select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
select ARCH_HAS_STRICT_MODULE_RWX if MMU
select ARCH_HAS_SYNC_DMA_FOR_DEVICE if SWIOTLB || !MMU
select ARCH_HAS_SYNC_DMA_FOR_CPU if SWIOTLB || !MMU
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
select ARCH_HAS_SYNC_DMA_FOR_CPU
select ARCH_HAS_TEARDOWN_DMA_OPS if MMU
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
select ARCH_HAVE_CUSTOM_GPIO_H
Expand Down
24 changes: 0 additions & 24 deletions arch/arm/include/asm/dma-mapping.h

This file was deleted.

2 changes: 1 addition & 1 deletion arch/arm/mach-highbank/highbank.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int highbank_platform_notifier(struct notifier_block *nb,
if (of_property_read_bool(dev->of_node, "dma-coherent")) {
val = readl(sregs_base + reg);
writel(val | 0xff01, sregs_base + reg);
set_dma_ops(dev, &arm_coherent_dma_ops);
dev->dma_coherent = true;
}

return NOTIFY_OK;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mvebu/coherency.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int mvebu_hwcc_notifier(struct notifier_block *nb,

if (event != BUS_NOTIFY_ADD_DEVICE)
return NOTIFY_DONE;
set_dma_ops(dev, &arm_coherent_dma_ops);
dev->dma_coherent = true;

return NOTIFY_OK;
}
Expand Down
Loading

0 comments on commit ae626eb

Please sign in to comment.