Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-mapping: move all DMA mapping code to kernel/dma

Currently the code is split over various files with dma- prefixes in the
lib/ and drives/base directories, and the number of files keeps growing.
Move them into a single directory to keep the code together and remove
the file name prefixes. To match the irq infrastructure this directory
is placed under the kernel/ directory.

Signed-off-by: Christoph Hellwig <hch@lst.de>

+69 -72
+2 -2
Documentation/driver-api/infrastructure.rst
··· 49 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 53 :export: 54 54 55 - .. kernel-doc:: drivers/base/dma-mapping.c 55 + .. kernel-doc:: kernel/dma/mapping.c 56 56 :export: 57 57 58 58 Device drivers PnP support
+2 -7
MAINTAINERS
··· 4359 4359 T: git git://git.infradead.org/users/hch/dma-mapping.git 4360 4360 W: http://git.infradead.org/users/hch/dma-mapping.git 4361 4361 S: Supported 4362 - F: lib/dma-debug.c 4363 - F: lib/dma-direct.c 4364 - F: lib/dma-noncoherent.c 4365 - F: lib/dma-virt.c 4366 - F: drivers/base/dma-mapping.c 4367 - F: drivers/base/dma-coherent.c 4362 + F: kernel/dma/ 4368 4363 F: include/asm-generic/dma-mapping.h 4369 4364 F: include/linux/dma-direct.h 4370 4365 F: include/linux/dma-mapping.h ··· 13637 13642 L: iommu@lists.linux-foundation.org 13638 13643 T: git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git 13639 13644 S: Supported 13640 - F: lib/swiotlb.c 13645 + F: kernel/dma/swiotlb.c 13641 13646 F: arch/*/kernel/pci-swiotlb.c 13642 13647 F: include/linux/swiotlb.h 13643 13648
-3
drivers/base/Makefile
··· 8 8 topology.o container.o property.o cacheinfo.o \ 9 9 devcon.o 10 10 obj-$(CONFIG_DEVTMPFS) += devtmpfs.o 11 - obj-$(CONFIG_DMA_CMA) += dma-contiguous.o 12 11 obj-y += power/ 13 - obj-$(CONFIG_HAS_DMA) += dma-mapping.o 14 - obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o 15 12 obj-$(CONFIG_ISA_BUS_API) += isa.o 16 13 obj-y += firmware_loader/ 17 14 obj-$(CONFIG_NUMA) += node.o
drivers/base/dma-coherent.c kernel/dma/coherent.c
drivers/base/dma-contiguous.c kernel/dma/contiguous.c
+1 -1
drivers/base/dma-mapping.c kernel/dma/mapping.c
··· 1 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 5 * Copyright (c) 2006 SUSE Linux Products GmbH 6 6 * Copyright (c) 2006 Tejun Heo <teheo@suse.de>
+1 -1
include/linux/dma-contiguous.h
··· 48 48 * CMA should not be used by the device drivers directly. It is 49 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 54 #ifdef __KERNEL__
-4
init/Kconfig
··· 1719 1719 1720 1720 endmenu # General setup 1721 1721 1722 - config HAVE_GENERIC_DMA_COHERENT 1723 - bool 1724 - default n 1725 - 1726 1722 config RT_MUTEXES 1727 1723 bool 1728 1724
+1
kernel/Makefile
··· 41 41 obj-y += irq/ 42 42 obj-y += rcu/ 43 43 obj-y += livepatch/ 44 + obj-y += dma/ 44 45 45 46 obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o 46 47 obj-$(CONFIG_FREEZER) += freezer.o
+50
kernel/dma/Kconfig
··· 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
+11
kernel/dma/Makefile
··· 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 +
+1 -46
lib/Kconfig
··· 420 420 depends on HAS_IOMEM && !NO_IOPORT_MAP 421 421 default y 422 422 423 - config HAS_DMA 424 - bool 425 - depends on !NO_DMA 426 - default y 423 + source "kernel/dma/Kconfig" 427 424 428 425 config SGL_ALLOC 429 426 bool 430 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 429 config IOMMU_HELPER 442 430 bool 443 - 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 431 477 432 config CHECK_SIGNATURE 478 433 bool
-6
lib/Makefile
··· 29 29 lib-$(CONFIG_PRINTK) += dump_stack.o 30 30 lib-$(CONFIG_MMU) += ioremap.o 31 31 lib-$(CONFIG_SMP) += cpumask.o 32 - obj-$(CONFIG_DMA_DIRECT_OPS) += dma-direct.o 33 - obj-$(CONFIG_DMA_NONCOHERENT_OPS) += dma-noncoherent.o 34 - obj-$(CONFIG_DMA_VIRT_OPS) += dma-virt.o 35 32 36 33 lib-y += kobject.o klist.o 37 34 obj-y += lockref.o ··· 145 148 obj-$(CONFIG_AUDIT_GENERIC) += audit.o 146 149 obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o 147 150 148 - obj-$(CONFIG_SWIOTLB) += swiotlb.o 149 151 obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o 150 152 obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o 151 153 obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o ··· 164 168 obj-$(CONFIG_NLATTR) += nlattr.o 165 169 166 170 obj-$(CONFIG_LRU_CACHE) += lru_cache.o 167 - 168 - obj-$(CONFIG_DMA_API_DEBUG) += dma-debug.o 169 171 170 172 obj-$(CONFIG_GENERIC_CSUM) += checksum.o 171 173
lib/dma-debug.c kernel/dma/debug.c
lib/dma-direct.c kernel/dma/direct.c
lib/dma-noncoherent.c kernel/dma/noncoherent.c
-2
lib/dma-virt.c kernel/dma/virt.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * lib/dma-virt.c 4 - * 5 3 * DMA operations that map to virtual addresses without flushing memory. 6 4 */ 7 5 #include <linux/export.h>
lib/swiotlb.c kernel/dma/swiotlb.c