aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-20 03:30:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-20 03:30:01 -0400
commit6d90eb7ba341b3eb035121eff0b69d370cbc251e (patch)
tree332809825f5aab97e839ab4534e5b81fb28e0c84
parentf5b65348fd77839b50e79bc0a5e536832ea52d8d (diff)
parentcf65a0f6f6ff7631ba0ac0513a14ca5b65320d80 (diff)
Merge tag 'dma-rename-4.18' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping rename from Christoph Hellwig: "Move all the dma-mapping code to kernel/dma and lose their dma-* prefixes" * tag 'dma-rename-4.18' of git://git.infradead.org/users/hch/dma-mapping: dma-mapping: move all DMA mapping code to kernel/dma dma-mapping: use obj-y instead of lib-y for generic dma ops
-rw-r--r--Documentation/driver-api/infrastructure.rst4
-rw-r--r--MAINTAINERS9
-rw-r--r--drivers/base/Makefile3
-rw-r--r--include/linux/dma-contiguous.h2
-rw-r--r--init/Kconfig4
-rw-r--r--kernel/Makefile1
-rw-r--r--kernel/dma/Kconfig50
-rw-r--r--kernel/dma/Makefile11
-rw-r--r--kernel/dma/coherent.c (renamed from drivers/base/dma-coherent.c)0
-rw-r--r--kernel/dma/contiguous.c (renamed from drivers/base/dma-contiguous.c)0
-rw-r--r--kernel/dma/debug.c (renamed from lib/dma-debug.c)0
-rw-r--r--kernel/dma/direct.c (renamed from lib/dma-direct.c)0
-rw-r--r--kernel/dma/mapping.c (renamed from drivers/base/dma-mapping.c)2
-rw-r--r--kernel/dma/noncoherent.c (renamed from lib/dma-noncoherent.c)0
-rw-r--r--kernel/dma/swiotlb.c (renamed from lib/swiotlb.c)0
-rw-r--r--kernel/dma/virt.c (renamed from lib/dma-virt.c)2
-rw-r--r--lib/Kconfig47
-rw-r--r--lib/Makefile6
18 files changed, 69 insertions, 72 deletions
diff --git a/Documentation/driver-api/infrastructure.rst b/Documentation/driver-api/infrastructure.rst
index bee1b9a1702f..6172f3cc3d0b 100644
--- a/Documentation/driver-api/infrastructure.rst
+++ b/Documentation/driver-api/infrastructure.rst
@@ -49,10 +49,10 @@ Device Drivers Base
49Device Drivers DMA Management 49Device Drivers DMA Management
50----------------------------- 50-----------------------------
51 51
52.. kernel-doc:: drivers/base/dma-coherent.c 52.. kernel-doc:: kernel/dma/coherent.c
53 :export: 53 :export:
54 54
55.. kernel-doc:: drivers/base/dma-mapping.c 55.. kernel-doc:: kernel/dma/mapping.c
56 :export: 56 :export:
57 57
58Device drivers PnP support 58Device drivers PnP support
diff --git a/MAINTAINERS b/MAINTAINERS
index 624c3fd11d04..1d7d648d8aad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4360,12 +4360,7 @@ L: iommu@lists.linux-foundation.org
4360T: git git://git.infradead.org/users/hch/dma-mapping.git 4360T: git git://git.infradead.org/users/hch/dma-mapping.git
4361W: http://git.infradead.org/users/hch/dma-mapping.git 4361W: http://git.infradead.org/users/hch/dma-mapping.git
4362S: Supported 4362S: Supported
4363F: lib/dma-debug.c 4363F: kernel/dma/
4364F: lib/dma-direct.c
4365F: lib/dma-noncoherent.c
4366F: lib/dma-virt.c
4367F: drivers/base/dma-mapping.c
4368F: drivers/base/dma-coherent.c
4369F: include/asm-generic/dma-mapping.h 4364F: include/asm-generic/dma-mapping.h
4370F: include/linux/dma-direct.h 4365F: include/linux/dma-direct.h
4371F: include/linux/dma-mapping.h 4366F: include/linux/dma-mapping.h
@@ -13648,7 +13643,7 @@ M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13648L: iommu@lists.linux-foundation.org 13643L: iommu@lists.linux-foundation.org
13649T: git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git 13644T: git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git
13650S: Supported 13645S: Supported
13651F: lib/swiotlb.c 13646F: kernel/dma/swiotlb.c
13652F: arch/*/kernel/pci-swiotlb.c 13647F: arch/*/kernel/pci-swiotlb.c
13653F: include/linux/swiotlb.h 13648F: include/linux/swiotlb.h
13654 13649
diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index b074f242a435..704f44295810 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -8,10 +8,7 @@ obj-y := component.o core.o bus.o dd.o syscore.o \
8 topology.o container.o property.o cacheinfo.o \ 8 topology.o container.o property.o cacheinfo.o \
9 devcon.o 9 devcon.o
10obj-$(CONFIG_DEVTMPFS) += devtmpfs.o 10obj-$(CONFIG_DEVTMPFS) += devtmpfs.o
11obj-$(CONFIG_DMA_CMA) += dma-contiguous.o
12obj-y += power/ 11obj-y += power/
13obj-$(CONFIG_HAS_DMA) += dma-mapping.o
14obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
15obj-$(CONFIG_ISA_BUS_API) += isa.o 12obj-$(CONFIG_ISA_BUS_API) += isa.o
16obj-y += firmware_loader/ 13obj-y += firmware_loader/
17obj-$(CONFIG_NUMA) += node.o 14obj-$(CONFIG_NUMA) += node.o
diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h
index b67bf6ac907d..3c5a4cb3eb95 100644
--- a/include/linux/dma-contiguous.h
+++ b/include/linux/dma-contiguous.h
@@ -48,7 +48,7 @@
48 * CMA should not be used by the device drivers directly. It is 48 * CMA should not be used by the device drivers directly. It is
49 * only a helper framework for dma-mapping subsystem. 49 * only a helper framework for dma-mapping subsystem.
50 * 50 *
51 * For more information, see kernel-docs in drivers/base/dma-contiguous.c 51 * For more information, see kernel-docs in kernel/dma/contiguous.c
52 */ 52 */
53 53
54#ifdef __KERNEL__ 54#ifdef __KERNEL__
diff --git a/init/Kconfig b/init/Kconfig
index 5a52f07259a2..fde3d09e8b27 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1719,10 +1719,6 @@ source "arch/Kconfig"
1719 1719
1720endmenu # General setup 1720endmenu # General setup
1721 1721
1722config HAVE_GENERIC_DMA_COHERENT
1723 bool
1724 default n
1725
1726config RT_MUTEXES 1722config RT_MUTEXES
1727 bool 1723 bool
1728 1724
diff --git a/kernel/Makefile b/kernel/Makefile
index d2001624fe7a..04bc07c2b42a 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -41,6 +41,7 @@ obj-y += printk/
41obj-y += irq/ 41obj-y += irq/
42obj-y += rcu/ 42obj-y += rcu/
43obj-y += livepatch/ 43obj-y += livepatch/
44obj-y += dma/
44 45
45obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o 46obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o
46obj-$(CONFIG_FREEZER) += freezer.o 47obj-$(CONFIG_FREEZER) += freezer.o
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
new file mode 100644
index 000000000000..9bd54304446f
--- /dev/null
+++ b/kernel/dma/Kconfig
@@ -0,0 +1,50 @@
1
2config HAS_DMA
3 bool
4 depends on !NO_DMA
5 default y
6
7config NEED_SG_DMA_LENGTH
8 bool
9
10config NEED_DMA_MAP_STATE
11 bool
12
13config ARCH_DMA_ADDR_T_64BIT
14 def_bool 64BIT || PHYS_ADDR_T_64BIT
15
16config HAVE_GENERIC_DMA_COHERENT
17 bool
18
19config ARCH_HAS_SYNC_DMA_FOR_DEVICE
20 bool
21
22config ARCH_HAS_SYNC_DMA_FOR_CPU
23 bool
24 select NEED_DMA_MAP_STATE
25
26config DMA_DIRECT_OPS
27 bool
28 depends on HAS_DMA
29
30config DMA_NONCOHERENT_OPS
31 bool
32 depends on HAS_DMA
33 select DMA_DIRECT_OPS
34
35config DMA_NONCOHERENT_MMAP
36 bool
37 depends on DMA_NONCOHERENT_OPS
38
39config DMA_NONCOHERENT_CACHE_SYNC
40 bool
41 depends on DMA_NONCOHERENT_OPS
42
43config DMA_VIRT_OPS
44 bool
45 depends on HAS_DMA
46
47config SWIOTLB
48 bool
49 select DMA_DIRECT_OPS
50 select NEED_DMA_MAP_STATE
diff --git a/kernel/dma/Makefile b/kernel/dma/Makefile
new file mode 100644
index 000000000000..6de44e4eb454
--- /dev/null
+++ b/kernel/dma/Makefile
@@ -0,0 +1,11 @@
1# SPDX-License-Identifier: GPL-2.0
2
3obj-$(CONFIG_HAS_DMA) += mapping.o
4obj-$(CONFIG_DMA_CMA) += contiguous.o
5obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += coherent.o
6obj-$(CONFIG_DMA_DIRECT_OPS) += direct.o
7obj-$(CONFIG_DMA_NONCOHERENT_OPS) += noncoherent.o
8obj-$(CONFIG_DMA_VIRT_OPS) += virt.o
9obj-$(CONFIG_DMA_API_DEBUG) += debug.o
10obj-$(CONFIG_SWIOTLB) += swiotlb.o
11
diff --git a/drivers/base/dma-coherent.c b/kernel/dma/coherent.c
index 597d40893862..597d40893862 100644
--- a/drivers/base/dma-coherent.c
+++ b/kernel/dma/coherent.c
diff --git a/drivers/base/dma-contiguous.c b/kernel/dma/contiguous.c
index d987dcd1bd56..d987dcd1bd56 100644
--- a/drivers/base/dma-contiguous.c
+++ b/kernel/dma/contiguous.c
diff --git a/lib/dma-debug.c b/kernel/dma/debug.c
index c007d25bee09..c007d25bee09 100644
--- a/lib/dma-debug.c
+++ b/kernel/dma/debug.c
diff --git a/lib/dma-direct.c b/kernel/dma/direct.c
index 8be8106270c2..8be8106270c2 100644
--- a/lib/dma-direct.c
+++ b/kernel/dma/direct.c
diff --git a/drivers/base/dma-mapping.c b/kernel/dma/mapping.c
index f831a582209c..d2a92ddaac4d 100644
--- a/drivers/base/dma-mapping.c
+++ b/kernel/dma/mapping.c
@@ -1,6 +1,6 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2/* 2/*
3 * drivers/base/dma-mapping.c - arch-independent dma-mapping routines 3 * arch-independent dma-mapping routines
4 * 4 *
5 * Copyright (c) 2006 SUSE Linux Products GmbH 5 * Copyright (c) 2006 SUSE Linux Products GmbH
6 * Copyright (c) 2006 Tejun Heo <teheo@suse.de> 6 * Copyright (c) 2006 Tejun Heo <teheo@suse.de>
diff --git a/lib/dma-noncoherent.c b/kernel/dma/noncoherent.c
index 79e9a757387f..79e9a757387f 100644
--- a/lib/dma-noncoherent.c
+++ b/kernel/dma/noncoherent.c
diff --git a/lib/swiotlb.c b/kernel/dma/swiotlb.c
index 04b68d9dffac..04b68d9dffac 100644
--- a/lib/swiotlb.c
+++ b/kernel/dma/swiotlb.c
diff --git a/lib/dma-virt.c b/kernel/dma/virt.c
index 8e61a02ef9ca..631ddec4b60a 100644
--- a/lib/dma-virt.c
+++ b/kernel/dma/virt.c
@@ -1,7 +1,5 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2/* 2/*
3 * lib/dma-virt.c
4 *
5 * DMA operations that map to virtual addresses without flushing memory. 3 * DMA operations that map to virtual addresses without flushing memory.
6 */ 4 */
7#include <linux/export.h> 5#include <linux/export.h>
diff --git a/lib/Kconfig b/lib/Kconfig
index e34b04b56057..706836ec314d 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -420,60 +420,15 @@ config HAS_IOPORT_MAP
420 depends on HAS_IOMEM && !NO_IOPORT_MAP 420 depends on HAS_IOMEM && !NO_IOPORT_MAP
421 default y 421 default y
422 422
423config HAS_DMA 423source "kernel/dma/Kconfig"
424 bool
425 depends on !NO_DMA
426 default y
427 424
428config SGL_ALLOC 425config SGL_ALLOC
429 bool 426 bool
430 default n 427 default n
431 428
432config NEED_SG_DMA_LENGTH
433 bool
434
435config NEED_DMA_MAP_STATE
436 bool
437
438config ARCH_DMA_ADDR_T_64BIT
439 def_bool 64BIT || PHYS_ADDR_T_64BIT
440
441config IOMMU_HELPER 429config IOMMU_HELPER
442 bool 430 bool
443 431
444config ARCH_HAS_SYNC_DMA_FOR_DEVICE
445 bool
446
447config ARCH_HAS_SYNC_DMA_FOR_CPU
448 bool
449 select NEED_DMA_MAP_STATE
450
451config DMA_DIRECT_OPS
452 bool
453 depends on HAS_DMA
454
455config DMA_NONCOHERENT_OPS
456 bool
457 depends on HAS_DMA
458 select DMA_DIRECT_OPS
459
460config DMA_NONCOHERENT_MMAP
461 bool
462 depends on DMA_NONCOHERENT_OPS
463
464config DMA_NONCOHERENT_CACHE_SYNC
465 bool
466 depends on DMA_NONCOHERENT_OPS
467
468config DMA_VIRT_OPS
469 bool
470 depends on HAS_DMA
471
472config SWIOTLB
473 bool
474 select DMA_DIRECT_OPS
475 select NEED_DMA_MAP_STATE
476
477config CHECK_SIGNATURE 432config CHECK_SIGNATURE
478 bool 433 bool
479 434
diff --git a/lib/Makefile b/lib/Makefile
index 956b320292fe..8153fdab287f 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -29,9 +29,6 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \
29lib-$(CONFIG_PRINTK) += dump_stack.o 29lib-$(CONFIG_PRINTK) += dump_stack.o
30lib-$(CONFIG_MMU) += ioremap.o 30lib-$(CONFIG_MMU) += ioremap.o
31lib-$(CONFIG_SMP) += cpumask.o 31lib-$(CONFIG_SMP) += cpumask.o
32lib-$(CONFIG_DMA_DIRECT_OPS) += dma-direct.o
33lib-$(CONFIG_DMA_NONCOHERENT_OPS) += dma-noncoherent.o
34lib-$(CONFIG_DMA_VIRT_OPS) += dma-virt.o
35 32
36lib-y += kobject.o klist.o 33lib-y += kobject.o klist.o
37obj-y += lockref.o 34obj-y += lockref.o
@@ -148,7 +145,6 @@ obj-$(CONFIG_SMP) += percpu_counter.o
148obj-$(CONFIG_AUDIT_GENERIC) += audit.o 145obj-$(CONFIG_AUDIT_GENERIC) += audit.o
149obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o 146obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o
150 147
151obj-$(CONFIG_SWIOTLB) += swiotlb.o
152obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o 148obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o
153obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o 149obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o
154obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o 150obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o
@@ -169,8 +165,6 @@ obj-$(CONFIG_NLATTR) += nlattr.o
169 165
170obj-$(CONFIG_LRU_CACHE) += lru_cache.o 166obj-$(CONFIG_LRU_CACHE) += lru_cache.o
171 167
172obj-$(CONFIG_DMA_API_DEBUG) += dma-debug.o
173
174obj-$(CONFIG_GENERIC_CSUM) += checksum.o 168obj-$(CONFIG_GENERIC_CSUM) += checksum.o
175 169
176obj-$(CONFIG_GENERIC_ATOMIC64) += atomic64.o 170obj-$(CONFIG_GENERIC_ATOMIC64) += atomic64.o