diff options
author | Christoph Hellwig <hch@lst.de> | 2021-02-10 10:56:39 +0100 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2021-02-13 09:51:45 +0100 |
commit | 6d4e9a8efe3d59f31367d79e970c2f328da139a4 (patch) | |
tree | 7e236f45053e397f6810c2494dda6c251b19a5bc /arch/mips | |
parent | 14ac09a65e19528ca05df56f8e36a4a8d4949795 (diff) | |
download | linux-6d4e9a8efe3d59f31367d79e970c2f328da139a4.tar.bz2 |
driver core: lift dma_default_coherent into common code
Lift the dma_default_coherent variable from the mips architecture code
to the driver core. This allows an architecture to sdefault all device
to be DMA coherent at run time, even if the kernel is build with support
for DMA noncoherent device. By allowing device_initialize to set the
->dma_coherent field to this default the amount of arch hooks required
for this behavior can be greatly reduced.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/alchemy/common/setup.c | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/dma-coherence.h | 22 | ||||
-rw-r--r-- | arch/mips/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/mips/mm/c-r4k.c | 2 | ||||
-rw-r--r-- | arch/mips/mm/dma-noncoherent.c | 1 | ||||
-rw-r--r-- | arch/mips/mti-malta/malta-setup.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/pci-alchemy.c | 2 | ||||
-rw-r--r-- | arch/mips/pistachio/init.c | 1 |
9 files changed, 4 insertions, 33 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 57b06798706c..a6d73c763be1 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -1163,7 +1163,6 @@ config ARCH_SUPPORTS_UPROBES bool config DMA_MAYBE_COHERENT - select ARCH_HAS_DMA_COHERENCE_H select DMA_NONCOHERENT bool diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c index 39e5b9cd882b..2388d68786f4 100644 --- a/arch/mips/alchemy/common/setup.c +++ b/arch/mips/alchemy/common/setup.c @@ -28,8 +28,8 @@ #include <linux/init.h> #include <linux/ioport.h> #include <linux/mm.h> +#include <linux/dma-map-ops.h> /* for dma_default_coherent */ -#include <asm/dma-coherence.h> #include <asm/mipsregs.h> #include <au1000.h> diff --git a/arch/mips/include/asm/dma-coherence.h b/arch/mips/include/asm/dma-coherence.h deleted file mode 100644 index 846c5ade30d1..000000000000 --- a/arch/mips/include/asm/dma-coherence.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> - * - */ -#ifndef __ASM_DMA_COHERENCE_H -#define __ASM_DMA_COHERENCE_H - -#ifdef CONFIG_DMA_MAYBE_COHERENT -extern bool dma_default_coherent; -static inline bool dev_is_dma_coherent(struct device *dev) -{ - return dma_default_coherent; -} -#else -#define dma_default_coherent (!IS_ENABLED(CONFIG_DMA_NONCOHERENT)) -#endif - -#endif diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 6008f45ad081..f0f533294311 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -36,7 +36,6 @@ #include <asm/cdmm.h> #include <asm/cpu.h> #include <asm/debug.h> -#include <asm/dma-coherence.h> #include <asm/sections.h> #include <asm/setup.h> #include <asm/smp-ops.h> @@ -803,9 +802,6 @@ arch_initcall(debugfs_mips); #endif #ifdef CONFIG_DMA_MAYBE_COHERENT -bool dma_default_coherent; -EXPORT_SYMBOL_GPL(dma_default_coherent); - static int __init setcoherentio(char *str) { dma_default_coherent = true; diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index bbfab94194b9..74b09e801c3a 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -19,6 +19,7 @@ #include <linux/mm.h> #include <linux/export.h> #include <linux/bitops.h> +#include <linux/dma-map-ops.h> /* for dma_default_coherent */ #include <asm/bcache.h> #include <asm/bootinfo.h> @@ -35,7 +36,6 @@ #include <asm/war.h> #include <asm/cacheflush.h> /* for run_uncached() */ #include <asm/traps.h> -#include <asm/dma-coherence.h> #include <asm/mips-cps.h> /* diff --git a/arch/mips/mm/dma-noncoherent.c b/arch/mips/mm/dma-noncoherent.c index 38d3d9143b47..90b562753eb8 100644 --- a/arch/mips/mm/dma-noncoherent.c +++ b/arch/mips/mm/dma-noncoherent.c @@ -10,7 +10,6 @@ #include <asm/cache.h> #include <asm/cpu-type.h> -#include <asm/dma-coherence.h> #include <asm/io.h> /* diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c index 1cdcb76d393e..21cb3ac1237b 100644 --- a/arch/mips/mti-malta/malta-setup.c +++ b/arch/mips/mti-malta/malta-setup.c @@ -13,8 +13,8 @@ #include <linux/pci.h> #include <linux/screen_info.h> #include <linux/time.h> +#include <linux/dma-map-ops.h> /* for dma_default_coherent */ -#include <asm/dma-coherence.h> #include <asm/fw/fw.h> #include <asm/mips-cps.h> #include <asm/mips-boards/generic.h> diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c index 54c86b40d304..1c722dd0c130 100644 --- a/arch/mips/pci/pci-alchemy.c +++ b/arch/mips/pci/pci-alchemy.c @@ -17,8 +17,8 @@ #include <linux/init.h> #include <linux/syscore_ops.h> #include <linux/vmalloc.h> +#include <linux/dma-map-ops.h> /* for dma_default_coherent */ -#include <asm/dma-coherence.h> #include <asm/mach-au1x00/au1000.h> #include <asm/tlbmisc.h> diff --git a/arch/mips/pistachio/init.c b/arch/mips/pistachio/init.c index 8e83262e9da8..e0bacfc3c6b4 100644 --- a/arch/mips/pistachio/init.c +++ b/arch/mips/pistachio/init.c @@ -13,7 +13,6 @@ #include <linux/of_fdt.h> #include <asm/cacheflush.h> -#include <asm/dma-coherence.h> #include <asm/fw/fw.h> #include <asm/mips-boards/generic.h> #include <asm/mips-cps.h> |