Commit 6d4e9a8e authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Thomas Bogendoerfer
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 14ac09a6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1163,7 +1163,6 @@ config ARCH_SUPPORTS_UPROBES
	bool

config DMA_MAYBE_COHERENT
	select ARCH_HAS_DMA_COHERENCE_H
	select DMA_NONCOHERENT
	bool

+1 −1
Original line number Diff line number Diff line
@@ -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>
+0 −22
Original line number Diff line number Diff line
/*
 * 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
+0 −4
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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>

/*
Loading