Commit c993e07b authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
  ...
parents 1d239c1e 5c850d31
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -5999,8 +5999,11 @@
			it if 0 is given (See Documentation/admin-guide/cgroup-v1/memory.rst)

	swiotlb=	[ARM,IA-64,PPC,MIPS,X86]
			Format: { <int> | force | noforce }
			Format: { <int> [,<int>] | force | noforce }
			<int> -- Number of I/O TLB slabs
			<int> -- Second integer after comma. Number of swiotlb
				 areas with their own lock. Will be rounded up
				 to a power of 2.
			force -- force using of bounce buffers even if they
			         wouldn't be automatically used by the kernel
			noforce -- Never use bounce buffers (for debugging)
+14 −0
Original line number Diff line number Diff line
@@ -204,6 +204,20 @@ Returns the maximum size of a mapping for the device. The size parameter
of the mapping functions like dma_map_single(), dma_map_page() and
others should not be larger than the returned value.

::

	size_t
	dma_opt_mapping_size(struct device *dev);

Returns the maximum optimal size of a mapping for the device.

Mapping larger buffers may take much longer in certain scenarios. In
addition, for high-rate short-lived streaming mappings, the upfront time
spent on the mapping may account for an appreciable part of the total
request lifetime. As such, if splitting larger requests incurs no
significant performance penalty, then device drivers are advised to
limit total DMA streaming mappings length to the returned value.

::

	bool
+5 −3
Original line number Diff line number Diff line
@@ -287,11 +287,13 @@ iommu options only relevant to the AMD GART hardware IOMMU:
iommu options only relevant to the software bounce buffering (SWIOTLB) IOMMU
implementation:

    swiotlb=<pages>[,force]
      <pages>
        Prereserve that many 128K pages for the software IO bounce buffering.
    swiotlb=<slots>[,force,noforce]
      <slots>
        Prereserve that many 2K slots for the software IO bounce buffering.
      force
        Force all IO through the software TLB.
      noforce
        Do not initialize the software TLB.


Miscellaneous
+2 −3
Original line number Diff line number Diff line
@@ -15,13 +15,12 @@ config ARM
	select ARCH_HAS_MEMBARRIER_SYNC_CORE
	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
	select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
	select ARCH_HAS_PHYS_TO_DMA
	select ARCH_HAS_SETUP_DMA_OPS
	select ARCH_HAS_SET_MEMORY
	select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
	select ARCH_HAS_STRICT_MODULE_RWX if MMU
	select ARCH_HAS_SYNC_DMA_FOR_DEVICE if SWIOTLB || !MMU
	select ARCH_HAS_SYNC_DMA_FOR_CPU if SWIOTLB || !MMU
	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
	select ARCH_HAS_SYNC_DMA_FOR_CPU
	select ARCH_HAS_TEARDOWN_DMA_OPS if MMU
	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
	select ARCH_HAVE_CUSTOM_GPIO_H
+1 −5
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
config SA1111
	bool
	select DMABOUNCE if !ARCH_PXA

config DMABOUNCE
	bool
	select ZONE_DMA
	select ZONE_DMA if ARCH_SA1100

config KRAIT_L2_ACCESSORS
	bool
Loading