Skip to content

Commit c993e07

Browse files
committed
Merge tag 'dma-mapping-5.20-2022-08-06' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping updates from Christoph Hellwig: - convert arm32 to the common dma-direct code (Arnd Bergmann, Robin Murphy, Christoph Hellwig) - restructure the PCIe peer to peer mapping support (Logan Gunthorpe) - allow the IOMMU code to communicate an optional DMA mapping length and use that in scsi and libata (John Garry) - split the global swiotlb lock (Tianyu Lan) - various fixes and cleanup (Chao Gao, Dan Carpenter, Dongli Zhang, Lukas Bulwahn, Robin Murphy) * tag 'dma-mapping-5.20-2022-08-06' of git://git.infradead.org/users/hch/dma-mapping: (45 commits) swiotlb: fix passing local variable to debugfs_create_ulong() dma-mapping: reformat comment to suppress htmldoc warning PCI/P2PDMA: Remove pci_p2pdma_[un]map_sg() RDMA/rw: drop pci_p2pdma_[un]map_sg() RDMA/core: introduce ib_dma_pci_p2p_dma_supported() nvme-pci: convert to using dma_map_sgtable() nvme-pci: check DMA ops when indicating support for PCI P2PDMA iommu/dma: support PCI P2PDMA pages in dma-iommu map_sg iommu: Explicitly skip bus address marked segments in __iommu_map_sg() dma-mapping: add flags to dma_map_ops to indicate PCI P2PDMA support dma-direct: support PCI P2PDMA pages in dma-direct map_sg dma-mapping: allow EREMOTEIO return code for P2PDMA transfers PCI/P2PDMA: Introduce helpers for dma_map_sg implementations PCI/P2PDMA: Attempt to set map_type if it has not been set lib/scatterlist: add flag for indicating P2PDMA segments in an SGL swiotlb: clean up some coding style and minor issues dma-mapping: update comment after dmabounce removal scsi: sd: Add a comment about limiting max_sectors to shost optimal limit ata: libata-scsi: cap ata_device->max_sectors according to shost->max_sectors scsi: scsi_transport_sas: cap shost opt_sectors according to DMA optimal limit ...
2 parents 1d239c1 + 5c850d3 commit c993e07

File tree

48 files changed

+833
-1694
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+833
-1694
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5999,8 +5999,11 @@
59995999
it if 0 is given (See Documentation/admin-guide/cgroup-v1/memory.rst)
60006000

60016001
swiotlb= [ARM,IA-64,PPC,MIPS,X86]
6002-
Format: { <int> | force | noforce }
6002+
Format: { <int> [,<int>] | force | noforce }
60036003
<int> -- Number of I/O TLB slabs
6004+
<int> -- Second integer after comma. Number of swiotlb
6005+
areas with their own lock. Will be rounded up
6006+
to a power of 2.
60046007
force -- force using of bounce buffers even if they
60056008
wouldn't be automatically used by the kernel
60066009
noforce -- Never use bounce buffers (for debugging)

Documentation/core-api/dma-api.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,20 @@ Returns the maximum size of a mapping for the device. The size parameter
204204
of the mapping functions like dma_map_single(), dma_map_page() and
205205
others should not be larger than the returned value.
206206

207+
::
208+
209+
size_t
210+
dma_opt_mapping_size(struct device *dev);
211+
212+
Returns the maximum optimal size of a mapping for the device.
213+
214+
Mapping larger buffers may take much longer in certain scenarios. In
215+
addition, for high-rate short-lived streaming mappings, the upfront time
216+
spent on the mapping may account for an appreciable part of the total
217+
request lifetime. As such, if splitting larger requests incurs no
218+
significant performance penalty, then device drivers are advised to
219+
limit total DMA streaming mappings length to the returned value.
220+
207221
::
208222

209223
bool

Documentation/x86/x86_64/boot-options.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,13 @@ iommu options only relevant to the AMD GART hardware IOMMU:
287287
iommu options only relevant to the software bounce buffering (SWIOTLB) IOMMU
288288
implementation:
289289

290-
swiotlb=<pages>[,force]
291-
<pages>
292-
Prereserve that many 128K pages for the software IO bounce buffering.
290+
swiotlb=<slots>[,force,noforce]
291+
<slots>
292+
Prereserve that many 2K slots for the software IO bounce buffering.
293293
force
294294
Force all IO through the software TLB.
295+
noforce
296+
Do not initialize the software TLB.
295297

296298

297299
Miscellaneous

arch/arm/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ config ARM
1515
select ARCH_HAS_MEMBARRIER_SYNC_CORE
1616
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
1717
select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
18-
select ARCH_HAS_PHYS_TO_DMA
1918
select ARCH_HAS_SETUP_DMA_OPS
2019
select ARCH_HAS_SET_MEMORY
2120
select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
2221
select ARCH_HAS_STRICT_MODULE_RWX if MMU
23-
select ARCH_HAS_SYNC_DMA_FOR_DEVICE if SWIOTLB || !MMU
24-
select ARCH_HAS_SYNC_DMA_FOR_CPU if SWIOTLB || !MMU
22+
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
23+
select ARCH_HAS_SYNC_DMA_FOR_CPU
2524
select ARCH_HAS_TEARDOWN_DMA_OPS if MMU
2625
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
2726
select ARCH_HAVE_CUSTOM_GPIO_H

arch/arm/common/Kconfig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
config SA1111
33
bool
4-
select DMABOUNCE if !ARCH_PXA
5-
6-
config DMABOUNCE
7-
bool
8-
select ZONE_DMA
4+
select ZONE_DMA if ARCH_SA1100
95

106
config KRAIT_L2_ACCESSORS
117
bool

arch/arm/common/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
obj-y += firmware.o
77

88
obj-$(CONFIG_SA1111) += sa1111.o
9-
obj-$(CONFIG_DMABOUNCE) += dmabounce.o
109
obj-$(CONFIG_KRAIT_L2_ACCESSORS) += krait-l2-accessors.o
1110
obj-$(CONFIG_SHARP_LOCOMO) += locomo.o
1211
obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o

0 commit comments

Comments
 (0)