dma-mapping: add a kconfig symbol for arch_teardown_dma_ops availability
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Catalin Marinas <catalin.marinas@arm.com> # arm64
This commit is contained in:
parent
347cb6af87
commit
dc2acded38
@ -16,6 +16,7 @@ config ARM
|
|||||||
select ARCH_HAS_SET_MEMORY
|
select ARCH_HAS_SET_MEMORY
|
||||||
select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
|
select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
|
||||||
select ARCH_HAS_STRICT_MODULE_RWX if MMU
|
select ARCH_HAS_STRICT_MODULE_RWX if MMU
|
||||||
|
select ARCH_HAS_TEARDOWN_DMA_OPS if MMU
|
||||||
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
||||||
select ARCH_HAVE_CUSTOM_GPIO_H
|
select ARCH_HAVE_CUSTOM_GPIO_H
|
||||||
select ARCH_HAS_GCOV_PROFILE_ALL
|
select ARCH_HAS_GCOV_PROFILE_ALL
|
||||||
|
@ -96,11 +96,6 @@ static inline unsigned long dma_max_pfn(struct device *dev)
|
|||||||
}
|
}
|
||||||
#define dma_max_pfn(dev) dma_max_pfn(dev)
|
#define dma_max_pfn(dev) dma_max_pfn(dev)
|
||||||
|
|
||||||
#ifdef CONFIG_MMU
|
|
||||||
#define arch_teardown_dma_ops arch_teardown_dma_ops
|
|
||||||
extern void arch_teardown_dma_ops(struct device *dev);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* do not use this function in a driver */
|
/* do not use this function in a driver */
|
||||||
static inline bool is_device_dma_coherent(struct device *dev)
|
static inline bool is_device_dma_coherent(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -29,6 +29,7 @@ config ARM64
|
|||||||
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
|
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
|
||||||
select ARCH_HAS_SYNC_DMA_FOR_CPU
|
select ARCH_HAS_SYNC_DMA_FOR_CPU
|
||||||
select ARCH_HAS_SYSCALL_WRAPPER
|
select ARCH_HAS_SYSCALL_WRAPPER
|
||||||
|
select ARCH_HAS_TEARDOWN_DMA_OPS if IOMMU_SUPPORT
|
||||||
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
||||||
select ARCH_HAVE_NMI_SAFE_CMPXCHG
|
select ARCH_HAVE_NMI_SAFE_CMPXCHG
|
||||||
select ARCH_INLINE_READ_LOCK if !PREEMPT
|
select ARCH_INLINE_READ_LOCK if !PREEMPT
|
||||||
|
@ -29,11 +29,6 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_IOMMU_DMA
|
|
||||||
void arch_teardown_dma_ops(struct device *dev);
|
|
||||||
#define arch_teardown_dma_ops arch_teardown_dma_ops
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do not use this function in a driver, it is only provided for
|
* Do not use this function in a driver, it is only provided for
|
||||||
* arch/arm/mm/xen.c, which is used by arm64 as well.
|
* arch/arm/mm/xen.c, which is used by arm64 as well.
|
||||||
|
@ -681,9 +681,13 @@ static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base,
|
|||||||
}
|
}
|
||||||
#endif /* CONFIG_ARCH_HAS_SETUP_DMA_OPS */
|
#endif /* CONFIG_ARCH_HAS_SETUP_DMA_OPS */
|
||||||
|
|
||||||
#ifndef arch_teardown_dma_ops
|
#ifdef CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS
|
||||||
static inline void arch_teardown_dma_ops(struct device *dev) { }
|
void arch_teardown_dma_ops(struct device *dev);
|
||||||
#endif
|
#else
|
||||||
|
static inline void arch_teardown_dma_ops(struct device *dev)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS */
|
||||||
|
|
||||||
static inline unsigned int dma_get_max_seg_size(struct device *dev)
|
static inline unsigned int dma_get_max_seg_size(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -22,6 +22,9 @@ config HAVE_GENERIC_DMA_COHERENT
|
|||||||
config ARCH_HAS_SETUP_DMA_OPS
|
config ARCH_HAS_SETUP_DMA_OPS
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
config ARCH_HAS_TEARDOWN_DMA_OPS
|
||||||
|
bool
|
||||||
|
|
||||||
config ARCH_HAS_SYNC_DMA_FOR_DEVICE
|
config ARCH_HAS_SYNC_DMA_FOR_DEVICE
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user