lkml.org 
[lkml]   [2019]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 01/19] dma-mapping: add a Kconfig symbol to indicated arch_dma_prep_coherent presence
    Date
    Add a Kconfig symbol that indicates an architecture provides a
    arch_dma_prep_coherent implementation, and provide a stub otherwise.

    This will allow the generic dma-iommu code to it while still allowing
    to be built for cache coherent architectures.

    Signed-off-by: Christoph Hellwig <hch@lst.de>
    ---
    arch/arm64/Kconfig | 1 +
    arch/csky/Kconfig | 1 +
    include/linux/dma-noncoherent.h | 6 ++++++
    kernel/dma/Kconfig | 3 +++
    4 files changed, 11 insertions(+)

    diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
    index a4168d366127..ae3f581a9bcc 100644
    --- a/arch/arm64/Kconfig
    +++ b/arch/arm64/Kconfig
    @@ -13,6 +13,7 @@ config ARM64
    select ARCH_HAS_DEVMEM_IS_ALLOWED
    select ARCH_HAS_DMA_COHERENT_TO_PFN
    select ARCH_HAS_DMA_MMAP_PGPROT
    + select ARCH_HAS_DMA_PREP_COHERENT
    select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
    select ARCH_HAS_ELF_RANDOMIZE
    select ARCH_HAS_FAST_MULTIPLIER
    diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig
    index 398113c845f5..8b84d4362ff6 100644
    --- a/arch/csky/Kconfig
    +++ b/arch/csky/Kconfig
    @@ -1,5 +1,6 @@
    config CSKY
    def_bool y
    + select ARCH_HAS_DMA_PREP_COHERENT
    select ARCH_HAS_SYNC_DMA_FOR_CPU
    select ARCH_HAS_SYNC_DMA_FOR_DEVICE
    select ARCH_USE_BUILTIN_BSWAP
    diff --git a/include/linux/dma-noncoherent.h b/include/linux/dma-noncoherent.h
    index 69b36ed31a99..9741767e400f 100644
    --- a/include/linux/dma-noncoherent.h
    +++ b/include/linux/dma-noncoherent.h
    @@ -72,6 +72,12 @@ static inline void arch_sync_dma_for_cpu_all(struct device *dev)
    }
    #endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */

    +#ifdef CONFIG_ARCH_HAS_DMA_PREP_COHERENT
    void arch_dma_prep_coherent(struct page *page, size_t size);
    +#else
    +static inline void arch_dma_prep_coherent(struct page *page, size_t size)
    +{
    +}
    +#endif /* CONFIG_ARCH_HAS_DMA_PREP_COHERENT */

    #endif /* _LINUX_DMA_NONCOHERENT_H */
    diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
    index ca88b867e7fe..541128a32c5d 100644
    --- a/kernel/dma/Kconfig
    +++ b/kernel/dma/Kconfig
    @@ -29,6 +29,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU
    config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
    bool

    +config ARCH_HAS_DMA_PREP_COHERENT
    + bool
    +
    config ARCH_HAS_DMA_COHERENT_TO_PFN
    bool

    --
    2.20.1
    \
     
     \ /
      Last update: 2019-01-14 10:44    [W:3.002 / U:0.208 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site