diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-20 03:30:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-20 03:30:01 -0400 |
commit | 6d90eb7ba341b3eb035121eff0b69d370cbc251e (patch) | |
tree | 332809825f5aab97e839ab4534e5b81fb28e0c84 | |
parent | f5b65348fd77839b50e79bc0a5e536832ea52d8d (diff) | |
parent | cf65a0f6f6ff7631ba0ac0513a14ca5b65320d80 (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.rst | 4 | ||||
-rw-r--r-- | MAINTAINERS | 9 | ||||
-rw-r--r-- | drivers/base/Makefile | 3 | ||||
-rw-r--r-- | include/linux/dma-contiguous.h | 2 | ||||
-rw-r--r-- | init/Kconfig | 4 | ||||
-rw-r--r-- | kernel/Makefile | 1 | ||||
-rw-r--r-- | kernel/dma/Kconfig | 50 | ||||
-rw-r--r-- | kernel/dma/Makefile | 11 | ||||
-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/Kconfig | 47 | ||||
-rw-r--r-- | lib/Makefile | 6 |
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 | |||
49 | Device Drivers DMA Management | 49 | Device 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 | ||
58 | Device drivers PnP support | 58 | Device 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 | |||
4360 | T: git git://git.infradead.org/users/hch/dma-mapping.git | 4360 | T: git git://git.infradead.org/users/hch/dma-mapping.git |
4361 | W: http://git.infradead.org/users/hch/dma-mapping.git | 4361 | W: http://git.infradead.org/users/hch/dma-mapping.git |
4362 | S: Supported | 4362 | S: Supported |
4363 | F: lib/dma-debug.c | 4363 | F: kernel/dma/ |
4364 | F: lib/dma-direct.c | ||
4365 | F: lib/dma-noncoherent.c | ||
4366 | F: lib/dma-virt.c | ||
4367 | F: drivers/base/dma-mapping.c | ||
4368 | F: drivers/base/dma-coherent.c | ||
4369 | F: include/asm-generic/dma-mapping.h | 4364 | F: include/asm-generic/dma-mapping.h |
4370 | F: include/linux/dma-direct.h | 4365 | F: include/linux/dma-direct.h |
4371 | F: include/linux/dma-mapping.h | 4366 | F: include/linux/dma-mapping.h |
@@ -13648,7 +13643,7 @@ M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | |||
13648 | L: iommu@lists.linux-foundation.org | 13643 | L: iommu@lists.linux-foundation.org |
13649 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git | 13644 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git |
13650 | S: Supported | 13645 | S: Supported |
13651 | F: lib/swiotlb.c | 13646 | F: kernel/dma/swiotlb.c |
13652 | F: arch/*/kernel/pci-swiotlb.c | 13647 | F: arch/*/kernel/pci-swiotlb.c |
13653 | F: include/linux/swiotlb.h | 13648 | F: 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 |
10 | obj-$(CONFIG_DEVTMPFS) += devtmpfs.o | 10 | obj-$(CONFIG_DEVTMPFS) += devtmpfs.o |
11 | obj-$(CONFIG_DMA_CMA) += dma-contiguous.o | ||
12 | obj-y += power/ | 11 | obj-y += power/ |
13 | obj-$(CONFIG_HAS_DMA) += dma-mapping.o | ||
14 | obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o | ||
15 | obj-$(CONFIG_ISA_BUS_API) += isa.o | 12 | obj-$(CONFIG_ISA_BUS_API) += isa.o |
16 | obj-y += firmware_loader/ | 13 | obj-y += firmware_loader/ |
17 | obj-$(CONFIG_NUMA) += node.o | 14 | obj-$(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 | ||
1720 | endmenu # General setup | 1720 | endmenu # General setup |
1721 | 1721 | ||
1722 | config HAVE_GENERIC_DMA_COHERENT | ||
1723 | bool | ||
1724 | default n | ||
1725 | |||
1726 | config RT_MUTEXES | 1722 | config 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/ | |||
41 | obj-y += irq/ | 41 | obj-y += irq/ |
42 | obj-y += rcu/ | 42 | obj-y += rcu/ |
43 | obj-y += livepatch/ | 43 | obj-y += livepatch/ |
44 | obj-y += dma/ | ||
44 | 45 | ||
45 | obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o | 46 | obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o |
46 | obj-$(CONFIG_FREEZER) += freezer.o | 47 | obj-$(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 | |||
2 | config HAS_DMA | ||
3 | bool | ||
4 | depends on !NO_DMA | ||
5 | default y | ||
6 | |||
7 | config NEED_SG_DMA_LENGTH | ||
8 | bool | ||
9 | |||
10 | config NEED_DMA_MAP_STATE | ||
11 | bool | ||
12 | |||
13 | config ARCH_DMA_ADDR_T_64BIT | ||
14 | def_bool 64BIT || PHYS_ADDR_T_64BIT | ||
15 | |||
16 | config HAVE_GENERIC_DMA_COHERENT | ||
17 | bool | ||
18 | |||
19 | config ARCH_HAS_SYNC_DMA_FOR_DEVICE | ||
20 | bool | ||
21 | |||
22 | config ARCH_HAS_SYNC_DMA_FOR_CPU | ||
23 | bool | ||
24 | select NEED_DMA_MAP_STATE | ||
25 | |||
26 | config DMA_DIRECT_OPS | ||
27 | bool | ||
28 | depends on HAS_DMA | ||
29 | |||
30 | config DMA_NONCOHERENT_OPS | ||
31 | bool | ||
32 | depends on HAS_DMA | ||
33 | select DMA_DIRECT_OPS | ||
34 | |||
35 | config DMA_NONCOHERENT_MMAP | ||
36 | bool | ||
37 | depends on DMA_NONCOHERENT_OPS | ||
38 | |||
39 | config DMA_NONCOHERENT_CACHE_SYNC | ||
40 | bool | ||
41 | depends on DMA_NONCOHERENT_OPS | ||
42 | |||
43 | config DMA_VIRT_OPS | ||
44 | bool | ||
45 | depends on HAS_DMA | ||
46 | |||
47 | config 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 | |||
3 | obj-$(CONFIG_HAS_DMA) += mapping.o | ||
4 | obj-$(CONFIG_DMA_CMA) += contiguous.o | ||
5 | obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += coherent.o | ||
6 | obj-$(CONFIG_DMA_DIRECT_OPS) += direct.o | ||
7 | obj-$(CONFIG_DMA_NONCOHERENT_OPS) += noncoherent.o | ||
8 | obj-$(CONFIG_DMA_VIRT_OPS) += virt.o | ||
9 | obj-$(CONFIG_DMA_API_DEBUG) += debug.o | ||
10 | obj-$(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 | ||
423 | config HAS_DMA | 423 | source "kernel/dma/Kconfig" |
424 | bool | ||
425 | depends on !NO_DMA | ||
426 | default y | ||
427 | 424 | ||
428 | config SGL_ALLOC | 425 | config SGL_ALLOC |
429 | bool | 426 | bool |
430 | default n | 427 | default n |
431 | 428 | ||
432 | config NEED_SG_DMA_LENGTH | ||
433 | bool | ||
434 | |||
435 | config NEED_DMA_MAP_STATE | ||
436 | bool | ||
437 | |||
438 | config ARCH_DMA_ADDR_T_64BIT | ||
439 | def_bool 64BIT || PHYS_ADDR_T_64BIT | ||
440 | |||
441 | config IOMMU_HELPER | 429 | config IOMMU_HELPER |
442 | bool | 430 | bool |
443 | 431 | ||
444 | config ARCH_HAS_SYNC_DMA_FOR_DEVICE | ||
445 | bool | ||
446 | |||
447 | config ARCH_HAS_SYNC_DMA_FOR_CPU | ||
448 | bool | ||
449 | select NEED_DMA_MAP_STATE | ||
450 | |||
451 | config DMA_DIRECT_OPS | ||
452 | bool | ||
453 | depends on HAS_DMA | ||
454 | |||
455 | config DMA_NONCOHERENT_OPS | ||
456 | bool | ||
457 | depends on HAS_DMA | ||
458 | select DMA_DIRECT_OPS | ||
459 | |||
460 | config DMA_NONCOHERENT_MMAP | ||
461 | bool | ||
462 | depends on DMA_NONCOHERENT_OPS | ||
463 | |||
464 | config DMA_NONCOHERENT_CACHE_SYNC | ||
465 | bool | ||
466 | depends on DMA_NONCOHERENT_OPS | ||
467 | |||
468 | config DMA_VIRT_OPS | ||
469 | bool | ||
470 | depends on HAS_DMA | ||
471 | |||
472 | config SWIOTLB | ||
473 | bool | ||
474 | select DMA_DIRECT_OPS | ||
475 | select NEED_DMA_MAP_STATE | ||
476 | |||
477 | config CHECK_SIGNATURE | 432 | config 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 \ | |||
29 | lib-$(CONFIG_PRINTK) += dump_stack.o | 29 | lib-$(CONFIG_PRINTK) += dump_stack.o |
30 | lib-$(CONFIG_MMU) += ioremap.o | 30 | lib-$(CONFIG_MMU) += ioremap.o |
31 | lib-$(CONFIG_SMP) += cpumask.o | 31 | lib-$(CONFIG_SMP) += cpumask.o |
32 | lib-$(CONFIG_DMA_DIRECT_OPS) += dma-direct.o | ||
33 | lib-$(CONFIG_DMA_NONCOHERENT_OPS) += dma-noncoherent.o | ||
34 | lib-$(CONFIG_DMA_VIRT_OPS) += dma-virt.o | ||
35 | 32 | ||
36 | lib-y += kobject.o klist.o | 33 | lib-y += kobject.o klist.o |
37 | obj-y += lockref.o | 34 | obj-y += lockref.o |
@@ -148,7 +145,6 @@ obj-$(CONFIG_SMP) += percpu_counter.o | |||
148 | obj-$(CONFIG_AUDIT_GENERIC) += audit.o | 145 | obj-$(CONFIG_AUDIT_GENERIC) += audit.o |
149 | obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o | 146 | obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o |
150 | 147 | ||
151 | obj-$(CONFIG_SWIOTLB) += swiotlb.o | ||
152 | obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o | 148 | obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o |
153 | obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o | 149 | obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o |
154 | obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o | 150 | obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o |
@@ -169,8 +165,6 @@ obj-$(CONFIG_NLATTR) += nlattr.o | |||
169 | 165 | ||
170 | obj-$(CONFIG_LRU_CACHE) += lru_cache.o | 166 | obj-$(CONFIG_LRU_CACHE) += lru_cache.o |
171 | 167 | ||
172 | obj-$(CONFIG_DMA_API_DEBUG) += dma-debug.o | ||
173 | |||
174 | obj-$(CONFIG_GENERIC_CSUM) += checksum.o | 168 | obj-$(CONFIG_GENERIC_CSUM) += checksum.o |
175 | 169 | ||
176 | obj-$(CONFIG_GENERIC_ATOMIC64) += atomic64.o | 170 | obj-$(CONFIG_GENERIC_ATOMIC64) += atomic64.o |