IB: Optimize DMA mapping
Subsystems (50)
v3 cover IB: Optimize DMA mapping
Hello Doug,
As you know there are two sets of DMA mapping operations in the Linux kernel:
- One set of DMA mapping operations that is used by most drivers.
- Another set of DMA mapping operations that is only used by the RDMA drivers.
Having two types of DMA mapping operations is not only a source of confusion but also a source of unnecessary overhead. The DMA mapping operations are in the hot path so it is important that the overhead of these operations is as low as possible. Hence this patch series that converts the RDMA code to the standard DMA mapping operations and thereby eliminates the if (dev->dma_ops) test from the hot path.
The changes compared to version 2 of this patch series are:
- Left out the inlining of the ib_dma_map_*() functions to keep the number of patches in this patch series reasonable.
- Reworked this patch series such that (hopefully) the hfi1 and qib drivers keep working.
The changes compared to version 1 of this patch series are:
- Patch "Move dma_ops from archdata into struct device" has been split into three patches.
- Patch "treewide: Inline ib_dma_map_*() functions" has been split into 15 patches (one per driver).
- A patch has been added that builds dma_noop_ops only for the architectures that need it.
- The new dma_virt_ops is only built if it is used by a driver.
- In these last 15 patches indentation has been adjusted to keep the arguments aligned with the opening parenthesis.
Bart Van Assche (37):
treewide: Constify most dma_map_ops structures
treewide: Move dma_ops from struct dev_archdata into struct device
treewide: Consolidate set_dma_ops() implementations
treewide: Consolidate get_dma_ops() implementations lib/dma-noop: Clarify a comment
lib/dma-noop: Only build dma_noop_ops for s390 and m32r lib/dma-virt: Add dma_virt_ops
IB/core: Remove ib_dma_*map_single_attrs()
RDS: IB: Remove an unused structure member
IB/core: Change the type of an ib_dma_alloc_coherent() argument IB/hf1: Remove DMA mapping code
IB/qib: Remove DMA mapping code
IB/core: Initialize ib_device.dev.parent earlier IB/core: Use dev.parent instead of dma_device
IB/cxgb3: Set dev.parent instead of dma_device IB/cxgb4: Set dev.parent instead of dma_device
IB/hfi1: Switch from dma_device to dev.parent
IB/hns: Switch from dma_device to dev.parent
IB/i40iw: Remove a superfluous assignment statement IB/mlx4: Switch from dma_device to dev.parent
IB/mlx5: Switch from dma_device to dev.parent
IB/mthca: Switch from dma_device to dev.parent
IB/nes: Remove a superfluous assignment statement IB/ocrdma: Switch from dma_device to dev.parent IB/qedr: Switch from dma_device to dev.parent
IB/qib: Switch from dma_device to dev.parent
IB/usnic: Switch from dma_device to dev.parent IB/vmw_pvrdma: Switch from dma_device to dev.parent IB/rxe: Switch from dma_device to dev.parent
IB/IPoIB: Switch from dma_device to dev.parent
IB/iser: Switch from dma_device to dev.parent
IB/srp: Switch from dma_device to dev.parent
IB/srpt: Modify a debug statement
RDS: net: Switch from dma_device to dev.parent
nvme-rdma: Switch from dma_device to dev.parent IB/core: Remove ib_device.dma_device
IB/rxe, IB/rdmavt: Use dma_virt_ops instead of duplicating it
arch/alpha/include/asm/dma-mapping.h | 4 +- arch/alpha/kernel/pci-noop.c | 4 +- arch/alpha/kernel/pci_iommu.c | 4 +- arch/arc/include/asm/dma-mapping.h | 4 +- arch/arc/mm/dma.c | 2 +- arch/arm/common/dmabounce.c | 2 +- arch/arm/include/asm/device.h | 1 - arch/arm/include/asm/dma-mapping.h | 20 +-- arch/arm/mm/dma-mapping.c | 22 +-- arch/arm/xen/mm.c | 4 +- arch/arm64/include/asm/device.h | 1 - arch/arm64/include/asm/dma-mapping.h | 12 +- arch/arm64/mm/dma-mapping.c | 14 +- arch/avr32/include/asm/dma-mapping.h | 4 +- arch/avr32/mm/dma-coherent.c | 2 +- arch/blackfin/include/asm/dma-mapping.h | 4 +- arch/blackfin/kernel/dma-mapping.c | 2 +- arch/c6x/include/asm/dma-mapping.h | 4 +- arch/c6x/kernel/dma.c | 2 +- arch/cris/arch-v32/drivers/pci/dma.c | 2 +- arch/cris/include/asm/dma-mapping.h | 6 +- arch/frv/include/asm/dma-mapping.h | 4 +- arch/frv/mb93090-mb00/pci-dma-nommu.c | 2 +- arch/frv/mb93090-mb00/pci-dma.c | 2 +- arch/h8300/include/asm/dma-mapping.h | 4 +- arch/h8300/kernel/dma.c | 2 +- arch/hexagon/include/asm/dma-mapping.h | 7 +- arch/hexagon/kernel/dma.c | 4 +- arch/ia64/hp/common/hwsw_iommu.c | 4 +- arch/ia64/hp/common/sba_iommu.c | 4 +- arch/ia64/include/asm/dma-mapping.h | 7 +- arch/ia64/include/asm/machvec.h | 4 +- arch/ia64/kernel/dma-mapping.c | 4 +- arch/ia64/kernel/pci-dma.c | 10 +- arch/ia64/kernel/pci-swiotlb.c | 2 +- arch/m32r/Kconfig | 1 + arch/m32r/include/asm/device.h | 1 - arch/m32r/include/asm/dma-mapping.h | 4 +- arch/m68k/include/asm/dma-mapping.h | 4 +- arch/m68k/kernel/dma.c | 2 +- arch/metag/include/asm/dma-mapping.h | 4 +- arch/metag/kernel/dma.c | 2 +- arch/microblaze/include/asm/dma-mapping.h | 4 +- arch/microblaze/kernel/dma.c | 2 +- arch/mips/cavium-octeon/dma-octeon.c | 4 +- arch/mips/include/asm/device.h | 5 - arch/mips/include/asm/dma-mapping.h | 9 +- .../include/asm/mach-cavium-octeon/dma-coherence.h | 2 +- arch/mips/include/asm/netlogic/common.h | 2 +- arch/mips/loongson64/common/dma-swiotlb.c | 2 +- arch/mips/mm/dma-default.c | 4 +- arch/mips/netlogic/common/nlm-dma.c | 2 +- arch/mips/pci/pci-octeon.c | 2 +- arch/mn10300/include/asm/dma-mapping.h | 4 +- arch/mn10300/mm/dma-alloc.c | 2 +- arch/nios2/include/asm/dma-mapping.h | 4 +- arch/nios2/mm/dma-mapping.c | 2 +- arch/openrisc/include/asm/dma-mapping.h | 4 +- arch/openrisc/kernel/dma.c | 2 +- arch/parisc/include/asm/dma-mapping.h | 8 +- arch/parisc/kernel/drivers.c | 2 +- arch/parisc/kernel/pci-dma.c | 4 +- arch/powerpc/include/asm/device.h | 4 - arch/powerpc/include/asm/dma-mapping.h | 14 +- arch/powerpc/include/asm/pci.h | 4 +- arch/powerpc/include/asm/ps3.h | 2 +- arch/powerpc/include/asm/swiotlb.h | 2 +- arch/powerpc/kernel/dma-swiotlb.c | 2 +- arch/powerpc/kernel/dma.c | 8 +- arch/powerpc/kernel/pci-common.c | 6 +- arch/powerpc/platforms/cell/iommu.c | 6 +- arch/powerpc/platforms/pasemi/iommu.c | 2 +- arch/powerpc/platforms/pasemi/setup.c | 2 +- arch/powerpc/platforms/powernv/npu-dma.c | 2 +- arch/powerpc/platforms/ps3/system-bus.c | 8 +- arch/powerpc/platforms/pseries/ibmebus.c | 4 +- arch/powerpc/platforms/pseries/vio.c | 2 +- arch/s390/Kconfig | 1 + arch/s390/include/asm/device.h | 1 - arch/s390/include/asm/dma-mapping.h | 6 +- arch/s390/pci/pci.c | 2 +- arch/s390/pci/pci_dma.c | 2 +- arch/sh/include/asm/dma-mapping.h | 4 +- arch/sh/kernel/dma-nommu.c | 2 +- arch/sh/mm/consistent.c | 2 +- arch/sparc/include/asm/dma-mapping.h | 10 +- arch/sparc/kernel/iommu.c | 4 +- arch/sparc/kernel/ioport.c | 8 +- arch/sparc/kernel/pci_sun4v.c | 2 +- arch/tile/include/asm/device.h | 3 - arch/tile/include/asm/dma-mapping.h | 20 +-- arch/tile/kernel/pci-dma.c | 24 +-- arch/unicore32/include/asm/dma-mapping.h | 4 +- arch/unicore32/mm/dma-swiotlb.c | 2 +- arch/x86/include/asm/device.h | 5 +- arch/x86/include/asm/dma-mapping.h | 11 +- arch/x86/include/asm/iommu.h | 2 +- arch/x86/kernel/amd_gart_64.c | 2 +- arch/x86/kernel/pci-calgary_64.c | 6 +- arch/x86/kernel/pci-dma.c | 4 +- arch/x86/kernel/pci-nommu.c | 2 +- arch/x86/kernel/pci-swiotlb.c | 2 +- arch/x86/pci/common.c | 2 +- arch/x86/pci/sta2x11-fixup.c | 10 +- arch/x86/xen/pci-swiotlb-xen.c | 2 +- arch/xtensa/include/asm/device.h | 4 - arch/xtensa/include/asm/dma-mapping.h | 9 +- arch/xtensa/kernel/pci-dma.c | 2 +- drivers/infiniband/core/device.c | 9 + drivers/infiniband/core/sysfs.c | 2 +- drivers/infiniband/core/ucm.c | 2 +- drivers/infiniband/core/user_mad.c | 4 +- drivers/infiniband/core/uverbs_main.c | 2 +- drivers/infiniband/hw/cxgb3/iwch_provider.c | 2 +- drivers/infiniband/hw/cxgb4/provider.c | 2 +- drivers/infiniband/hw/hfi1/dma.c | 183 ------------------- drivers/infiniband/hw/hfi1/mad.c | 2 +- drivers/infiniband/hw/hfi1/verbs.c | 2 +- drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +- drivers/infiniband/hw/i40iw/i40iw_verbs.c | 1 - drivers/infiniband/hw/mlx4/main.c | 2 +- drivers/infiniband/hw/mlx4/mlx4_ib.h | 2 +- drivers/infiniband/hw/mlx4/mr.c | 6 +- drivers/infiniband/hw/mlx5/main.c | 2 +- drivers/infiniband/hw/mlx5/mr.c | 14 +- drivers/infiniband/hw/mthca/mthca_provider.c | 2 +- drivers/infiniband/hw/nes/nes_verbs.c | 1 - drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- drivers/infiniband/hw/qedr/main.c | 2 +- drivers/infiniband/hw/qib/qib_dma.c | 169 ------------------ drivers/infiniband/hw/qib/qib_keys.c | 5 +- drivers/infiniband/hw/qib/qib_verbs.c | 2 +- drivers/infiniband/hw/usnic/usnic_ib_main.c | 2 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +- drivers/infiniband/sw/rdmavt/Kconfig | 1 + drivers/infiniband/sw/rdmavt/Makefile | 2 +- drivers/infiniband/sw/rdmavt/dma.c | 198 --------------------- drivers/infiniband/sw/rdmavt/dma.h | 53 ------ drivers/infiniband/sw/rdmavt/mr.c | 8 +- drivers/infiniband/sw/rdmavt/vt.c | 4 +- drivers/infiniband/sw/rdmavt/vt.h | 1 - drivers/infiniband/sw/rxe/Kconfig | 1 + drivers/infiniband/sw/rxe/Makefile | 1 - drivers/infiniband/sw/rxe/rxe_dma.c | 183 ------------------- drivers/infiniband/sw/rxe/rxe_loc.h | 2 - drivers/infiniband/sw/rxe/rxe_verbs.c | 9 +- drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +- drivers/infiniband/ulp/srp/ib_srp.c | 4 +- drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +- drivers/iommu/amd_iommu.c | 10 +- drivers/misc/mic/bus/mic_bus.c | 4 +- drivers/misc/mic/bus/scif_bus.c | 4 +- drivers/misc/mic/bus/scif_bus.h | 2 +- drivers/misc/mic/bus/vop_bus.c | 2 +- drivers/misc/mic/host/mic_boot.c | 4 +- drivers/nvme/host/rdma.c | 2 +- drivers/parisc/ccio-dma.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/pci/host/vmd.c | 2 +- include/linux/device.h | 1 + include/linux/dma-mapping.h | 55 +++--- include/linux/mic_bus.h | 2 +- include/rdma/ib_verbs.h | 143 ++------------- include/xen/arm/hypervisor.h | 2 +- lib/Kconfig | 10 ++ lib/Makefile | 3 +- lib/dma-noop.c | 4 +- lib/dma-virt.c | 72 ++++++++ net/rds/ib.h | 8 +- net/rds/ib_mr.h | 1 - 173 files changed, 437 insertions(+), 1298 deletions(-) delete mode 100644 drivers/infiniband/hw/hfi1/dma.c delete mode 100644 drivers/infiniband/hw/qib/qib_dma.c delete mode 100644 drivers/infiniband/sw/rdmavt/dma.c delete mode 100644 drivers/infiniband/sw/rdmavt/dma.h delete mode 100644 drivers/infiniband/sw/rxe/rxe_dma.c create mode 100644 lib/dma-virt.c
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 1/37 treewide: Constify most dma_map_ops structures
Most dma_map_ops structures are never modified. Constify these structures such that these can be write-protected. This patch has been generated as follows:
git grep -l 'struct dma_map_ops' |
xargs -d\\n sed -i \
-e 's/struct dma_map_ops/const struct dma_map_ops/g' \
-e 's/const struct dma_map_ops {/struct dma_map_ops {/g' \
-e 's/^const struct dma_map_ops;$/struct dma_map_ops;/' \
-e 's/const const struct dma_map_ops /const struct dma_map_ops /g';sed -i -e 's/const \(struct dma_map_ops intel_dma_ops\)/\1/' \
$(git grep -l 'struct dma_map_ops intel_dma_ops');
sed -i -e 's/const \(struct dma_map_ops dma_iommu_ops\)/\1/' \
$(git grep -l 'struct dma_map_ops' | grep ^arch/powerpc);
sed -i -e '/^struct vmd_dev {$/,/^};$/ s/const \(struct dma_map_ops[[:blank:]]dma_ops;\)/\1/' \
-e '/^static void vmd_setup_dma_ops/,/^}$/ s/const \(struct dma_map_ops \*dest\)/\1/' \
-e 's/const \(struct dma_map_ops \*dest = \&vmd->dma_ops\)/\1/' \
drivers/pci/host/*.csed -i -e '/^void __init pci_iommu_alloc(void)$/,/^}$/ s/dma_ops->/intel_dma_ops./' arch/ia64/kernel/pci-dma.c sed -i -e 's/static const struct dma_map_ops sn_dma_ops/static struct dma_map_ops sn_dma_ops/' arch/ia64/sn/pci/pci_dma.c sed -i -e 's/(const struct dma_map_ops \*)//' drivers/misc/mic/bus/vop_bus.c
--- arch/alpha/include/asm/dma-mapping.h | 4 +-- arch/alpha/kernel/pci-noop.c | 4 +-- arch/alpha/kernel/pci_iommu.c | 4 +-- arch/arc/include/asm/dma-mapping.h | 4 +-- arch/arc/mm/dma.c | 2 +- arch/arm/common/dmabounce.c | 2 +- arch/arm/include/asm/device.h | 2 +- arch/arm/include/asm/dma-mapping.h | 10 +++--- arch/arm/mm/dma-mapping.c | 22 ++++++------ arch/arm/xen/mm.c | 4 +-- arch/arm64/include/asm/device.h | 2 +- arch/arm64/include/asm/dma-mapping.h | 6 ++-- arch/arm64/mm/dma-mapping.c | 6 ++-- arch/avr32/include/asm/dma-mapping.h | 4 +-- arch/avr32/mm/dma-coherent.c | 2 +- arch/blackfin/include/asm/dma-mapping.h | 4 +-- arch/blackfin/kernel/dma-mapping.c | 2 +- arch/c6x/include/asm/dma-mapping.h | 4 +-- arch/c6x/kernel/dma.c | 2 +- arch/cris/arch-v32/drivers/pci/dma.c | 2 +- arch/cris/include/asm/dma-mapping.h | 6 ++-- arch/frv/include/asm/dma-mapping.h | 4 +-- arch/frv/mb93090-mb00/pci-dma-nommu.c | 2 +- arch/frv/mb93090-mb00/pci-dma.c | 2 +- arch/h8300/include/asm/dma-mapping.h | 4 +-- arch/h8300/kernel/dma.c | 2 +- arch/hexagon/include/asm/dma-mapping.h | 4 +-- arch/hexagon/kernel/dma.c | 4 +-- arch/ia64/hp/common/hwsw_iommu.c | 4 +-- arch/ia64/hp/common/sba_iommu.c | 4 +-- arch/ia64/include/asm/dma-mapping.h | 2 +- arch/ia64/include/asm/machvec.h | 4 +-- arch/ia64/kernel/dma-mapping.c | 4 +-- arch/ia64/kernel/pci-dma.c | 10 +++--- arch/ia64/kernel/pci-swiotlb.c | 2 +- arch/m32r/include/asm/device.h | 2 +- arch/m32r/include/asm/dma-mapping.h | 2 +- arch/m68k/include/asm/dma-mapping.h | 4 +-- arch/m68k/kernel/dma.c | 2 +- arch/metag/include/asm/dma-mapping.h | 4 +-- arch/metag/kernel/dma.c | 2 +- arch/microblaze/include/asm/dma-mapping.h | 4 +-- arch/microblaze/kernel/dma.c | 2 +- arch/mips/cavium-octeon/dma-octeon.c | 4 +-- arch/mips/include/asm/device.h | 2 +- arch/mips/include/asm/dma-mapping.h | 4 +-- .../include/asm/mach-cavium-octeon/dma-coherence.h | 2 +- arch/mips/include/asm/netlogic/common.h | 2 +- arch/mips/loongson64/common/dma-swiotlb.c | 2 +- arch/mips/mm/dma-default.c | 4 +-- arch/mips/netlogic/common/nlm-dma.c | 2 +- arch/mn10300/include/asm/dma-mapping.h | 4 +-- arch/mn10300/mm/dma-alloc.c | 2 +- arch/nios2/include/asm/dma-mapping.h | 4 +-- arch/nios2/mm/dma-mapping.c | 2 +- arch/openrisc/include/asm/dma-mapping.h | 4 +-- arch/openrisc/kernel/dma.c | 2 +- arch/parisc/include/asm/dma-mapping.h | 8 ++--- arch/parisc/kernel/drivers.c | 2 +- arch/parisc/kernel/pci-dma.c | 4 +-- arch/powerpc/include/asm/device.h | 2 +- arch/powerpc/include/asm/dma-mapping.h | 6 ++-- arch/powerpc/include/asm/pci.h | 4 +-- arch/powerpc/include/asm/swiotlb.h | 2 +- arch/powerpc/kernel/dma-swiotlb.c | 2 +- arch/powerpc/kernel/dma.c | 6 ++-- arch/powerpc/kernel/pci-common.c | 6 ++-- arch/powerpc/platforms/cell/iommu.c | 4 +-- arch/powerpc/platforms/powernv/npu-dma.c | 2 +- arch/powerpc/platforms/ps3/system-bus.c | 4 +-- arch/powerpc/platforms/pseries/ibmebus.c | 2 +- arch/powerpc/platforms/pseries/vio.c | 2 +- arch/s390/include/asm/device.h | 2 +- arch/s390/include/asm/dma-mapping.h | 4 +-- arch/s390/pci/pci_dma.c | 2 +- arch/sh/include/asm/dma-mapping.h | 4 +-- arch/sh/kernel/dma-nommu.c | 2 +- arch/sh/mm/consistent.c | 2 +- arch/sparc/include/asm/dma-mapping.h | 8 ++--- arch/sparc/kernel/iommu.c | 4 +-- arch/sparc/kernel/ioport.c | 8 ++--- arch/sparc/kernel/pci_sun4v.c | 2 +- arch/tile/include/asm/device.h | 2 +- arch/tile/include/asm/dma-mapping.h | 12 +++---- arch/tile/kernel/pci-dma.c | 24 ++++++------- arch/unicore32/include/asm/dma-mapping.h | 4 +-- arch/unicore32/mm/dma-swiotlb.c | 2 +- arch/x86/include/asm/device.h | 4 +-- arch/x86/include/asm/dma-mapping.h | 4 +-- arch/x86/include/asm/iommu.h | 2 +- arch/x86/kernel/amd_gart_64.c | 2 +- arch/x86/kernel/pci-calgary_64.c | 2 +- arch/x86/kernel/pci-dma.c | 4 +-- arch/x86/kernel/pci-nommu.c | 2 +- arch/x86/kernel/pci-swiotlb.c | 2 +- arch/x86/pci/sta2x11-fixup.c | 2 +- arch/x86/xen/pci-swiotlb-xen.c | 2 +- arch/xtensa/include/asm/device.h | 2 +- arch/xtensa/include/asm/dma-mapping.h | 4 +-- arch/xtensa/kernel/pci-dma.c | 2 +- drivers/iommu/amd_iommu.c | 4 +-- drivers/misc/mic/bus/mic_bus.c | 2 +- drivers/misc/mic/bus/scif_bus.c | 2 +- drivers/misc/mic/bus/scif_bus.h | 2 +- drivers/misc/mic/bus/vop_bus.c | 2 +- drivers/misc/mic/host/mic_boot.c | 4 +-- drivers/parisc/ccio-dma.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/pci/host/vmd.c | 2 +- include/linux/dma-mapping.h | 42 +++++++++++----------- include/linux/mic_bus.h | 2 +- include/xen/arm/hypervisor.h | 2 +- lib/dma-noop.c | 2 +- 113 files changed, 227 insertions(+), 227 deletions(-)
arch/alpha/include/asm/dma-mapping.h +2 -2
@@ -1,9 +1,9 @@#ifndef _ALPHA_DMA_MAPPING_H#define _ALPHA_DMA_MAPPING_H -extern struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return dma_ops; }
arch/alpha/kernel/pci-noop.c +2 -2
@@ -128,7 +128,7 @@ static int alpha_noop_supported(struct device *dev, u64 mask)return mask <0x00ffffffUL ?0 :1 ; } -struct dma_map_ops alpha_noop_ops = { +const struct dma_map_ops alpha_noop_ops = { .alloc = alpha_noop_alloc_coherent, .free = dma_noop_free_coherent, .map_page = dma_noop_map_page,
@@ -137,5 +137,5 @@ struct dma_map_ops alpha_noop_ops = { .dma_supported = alpha_noop_supported, }; -struct dma_map_ops *dma_ops = &alpha_noop_ops; +const struct dma_map_ops *dma_ops = &alpha_noop_ops;EXPORT_SYMBOL (dma_ops);
arch/alpha/kernel/pci_iommu.c +2 -2
@@ -939,7 +939,7 @@ static int alpha_pci_mapping_error(struct device *dev, dma_addr_t dma_addr)return dma_addr ==0 ; } -struct dma_map_ops alpha_pci_ops = { +const struct dma_map_ops alpha_pci_ops = { .alloc = alpha_pci_alloc_coherent, .free = alpha_pci_free_coherent, .map_page = alpha_pci_map_page,
@@ -950,5 +950,5 @@ struct dma_map_ops alpha_pci_ops = { .dma_supported = alpha_pci_supported, }; -struct dma_map_ops *dma_ops = &alpha_pci_ops; +const struct dma_map_ops *dma_ops = &alpha_pci_ops;EXPORT_SYMBOL (dma_ops);
arch/arc/include/asm/dma-mapping.h +2 -2
@@ -18,9 +18,9 @@#include <plat/dma.h> #endif -extern struct dma_map_ops arc_dma_ops; +extern const struct dma_map_ops arc_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &arc_dma_ops; }
arch/arc/mm/dma.c +1 -1
@@ -218,7 +218,7 @@ static int arc_dma_supported(struct device *dev, u64 dma_mask)return dma_mask ==DMA_BIT_MASK (32 ); } -struct dma_map_ops arc_dma_ops = { +const struct dma_map_ops arc_dma_ops = { .alloc = arc_dma_alloc, .free = arc_dma_free, .mmap = arc_dma_mmap,
arch/arm/common/dmabounce.c +1 -1
@@ -452,7 +452,7 @@ static int dmabounce_set_mask(struct device *dev, u64 dma_mask)return arm_dma_ops.set_dma_mask (dev, dma_mask); } -static struct dma_map_ops dmabounce_ops = { +static const struct dma_map_ops dmabounce_ops = { .alloc = arm_dma_alloc, .free = arm_dma_free, .mmap = arm_dma_mmap,
arch/arm/include/asm/device.h +1 -1
@@ -7,7 +7,7 @@#define ASMARM_DEVICE_H struct dev_archdata { -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;#ifdef CONFIG_DMABOUNCE struct dmabounce_device_info *dmabounce;#endif
arch/arm/include/asm/dma-mapping.h +5 -5
@@ -13,17 +13,17 @@#include <asm/xen/hypervisor.h> #define DMA_ERROR_CODE (~(dma_addr_t)0x0) -extern struct dma_map_ops arm_dma_ops; -extern struct dma_map_ops arm_coherent_dma_ops; +extern const struct dma_map_ops arm_dma_ops; +extern const struct dma_map_ops arm_coherent_dma_ops; -static inline struct dma_map_ops *__generic_dma_ops (struct device *dev) +static inline const struct dma_map_ops *__generic_dma_ops (struct device *dev) {if (dev && dev->archdata.dma_ops)return dev->archdata.dma_ops;return &arm_dma_ops; } -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {if (xen_initial_domain ())return xen_dma_ops;
@@ -31,7 +31,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)return __generic_dma_ops (dev); } -static inline void set_dma_ops (struct device *dev,struct dma_map_ops *ops) +static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) {BUG_ON (!dev); dev->archdata.dma_ops = ops;
arch/arm/mm/dma-mapping.c +11 -11
@@ -180,7 +180,7 @@ static void arm_dma_sync_single_for_device(struct device *dev,__dma_page_cpu_to_dev (page, offset, size, dir); } -struct dma_map_ops arm_dma_ops = { +const struct dma_map_ops arm_dma_ops = { .alloc = arm_dma_alloc, .free = arm_dma_free, .mmap = arm_dma_mmap,
@@ -204,7 +204,7 @@ static int arm_coherent_dma_mmap(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, unsigned long attrs); -struct dma_map_ops arm_coherent_dma_ops = { +const struct dma_map_ops arm_coherent_dma_ops = { .alloc = arm_coherent_dma_alloc, .free = arm_coherent_dma_free, .mmap = arm_coherent_dma_mmap,
@@ -1067,7 +1067,7 @@ static void __dma_page_dev_to_cpu(struct page *page, unsigned long off,int arm_dma_map_sg (struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir,unsigned long attrs) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);struct scatterlist *s;int i, j;
@@ -1101,7 +1101,7 @@ int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,void arm_dma_unmap_sg (struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir,unsigned long attrs) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);struct scatterlist *s;int i;
@@ -1120,7 +1120,7 @@ void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,void arm_dma_sync_sg_for_cpu (struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);struct scatterlist *s;int i;
@@ -1139,7 +1139,7 @@ void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,void arm_dma_sync_sg_for_device (struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);struct scatterlist *s;int i;
@@ -2099,7 +2099,7 @@ static void arm_iommu_sync_single_for_device(struct device *dev,__dma_page_cpu_to_dev (page, offset, size, dir); } -struct dma_map_ops iommu_ops = { +const struct dma_map_ops iommu_ops = { .alloc = arm_iommu_alloc_attrs, .free = arm_iommu_free_attrs, .mmap = arm_iommu_mmap_attrs,
@@ -2119,7 +2119,7 @@ struct dma_map_ops iommu_ops = { .unmap_resource = arm_iommu_unmap_resource, }; -struct dma_map_ops iommu_coherent_ops = { +const struct dma_map_ops iommu_coherent_ops = { .alloc = arm_coherent_iommu_alloc_attrs, .free = arm_coherent_iommu_free_attrs, .mmap = arm_coherent_iommu_mmap_attrs,
@@ -2319,7 +2319,7 @@ void arm_iommu_detach_device(struct device *dev) }EXPORT_SYMBOL_GPL (arm_iommu_detach_device); -static struct dma_map_ops *arm_get_iommu_dma_map_ops (bool coherent) +static const struct dma_map_ops *arm_get_iommu_dma_map_ops (bool coherent) {return coherent ? &iommu_coherent_ops : &iommu_ops; }
@@ -2374,7 +2374,7 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) { }#endif /* CONFIG_ARM_DMA_USE_IOMMU */ -static struct dma_map_ops *arm_get_dma_map_ops (bool coherent) +static const struct dma_map_ops *arm_get_dma_map_ops (bool coherent) {return coherent ? &arm_coherent_dma_ops : &arm_dma_ops; }
@@ -2382,7 +2382,7 @@ static struct dma_map_ops *arm_get_dma_map_ops(bool coherent)void arch_setup_dma_ops (struct device *dev,u64 dma_base,u64 size,const struct iommu_ops *iommu,bool coherent) { -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops; dev->archdata.dma_coherent = coherent;if (arm_setup_iommu_dma_ops (dev, dma_base, size, iommu))
arch/arm/xen/mm.c +2 -2
@@ -182,10 +182,10 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order) }EXPORT_SYMBOL_GPL (xen_destroy_contiguous_region); -struct dma_map_ops *xen_dma_ops; +const struct dma_map_ops *xen_dma_ops;EXPORT_SYMBOL (xen_dma_ops); -static struct dma_map_ops xen_swiotlb_dma_ops = { +static const struct dma_map_ops xen_swiotlb_dma_ops = { .alloc = xen_swiotlb_alloc_coherent, .free = xen_swiotlb_free_coherent, .sync_single_for_cpu = xen_swiotlb_sync_single_for_cpu,
arch/arm64/include/asm/device.h +1 -1
@@ -17,7 +17,7 @@#define __ASM_DEVICE_Hstruct dev_archdata { -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;#ifdef CONFIG_IOMMU_API void *iommu;/* private IOMMU data */ #endif
arch/arm64/include/asm/dma-mapping.h +3 -3
@@ -25,9 +25,9 @@#include <asm/xen/hypervisor.h> #define DMA_ERROR_CODE (~(dma_addr_t)0) -extern struct dma_map_ops dummy_dma_ops; +extern const struct dma_map_ops dummy_dma_ops; -static inline struct dma_map_ops *__generic_dma_ops (struct device *dev) +static inline const struct dma_map_ops *__generic_dma_ops (struct device *dev) {if (dev && dev->archdata.dma_ops)return dev->archdata.dma_ops;
@@ -39,7 +39,7 @@ static inline struct dma_map_ops *__generic_dma_ops(struct device *dev)return &dummy_dma_ops; } -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {if (xen_initial_domain ())return xen_dma_ops;
arch/arm64/mm/dma-mapping.c +3 -3
@@ -352,7 +352,7 @@ static int __swiotlb_dma_supported(struct device *hwdev, u64 mask)return 1 ; } -static struct dma_map_ops swiotlb_dma_ops = { +static const struct dma_map_ops swiotlb_dma_ops = { .alloc = __dma_alloc, .free = __dma_free, .mmap = __swiotlb_mmap,
@@ -505,7 +505,7 @@ static int __dummy_dma_supported(struct device *hwdev, u64 mask)return 0 ; } -struct dma_map_ops dummy_dma_ops = { +const struct dma_map_ops dummy_dma_ops = { .alloc = __dummy_alloc, .free = __dummy_free, .mmap = __dummy_mmap,
@@ -784,7 +784,7 @@ static void __iommu_unmap_sg_attrs(struct device *dev,iommu_dma_unmap_sg (dev, sgl, nelems, dir, attrs); } -static struct dma_map_ops iommu_dma_ops = { +static const struct dma_map_ops iommu_dma_ops = { .alloc = __iommu_alloc_attrs, .free = __iommu_free_attrs, .mmap = __iommu_mmap_attrs,
arch/avr32/include/asm/dma-mapping.h +2 -2
@@ -4,9 +4,9 @@extern void dma_cache_sync (struct device *dev,void *vaddr,size_t size,int direction); -extern struct dma_map_ops avr32_dma_ops; +extern const struct dma_map_ops avr32_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &avr32_dma_ops; }
arch/avr32/mm/dma-coherent.c +1 -1
@@ -191,7 +191,7 @@ static void avr32_dma_sync_sg_for_device(struct device *dev,dma_cache_sync (dev,sg_virt (sg), sg->length, direction); } -struct dma_map_ops avr32_dma_ops = { +const struct dma_map_ops avr32_dma_ops = { .alloc = avr32_dma_alloc, .free = avr32_dma_free, .map_page = avr32_dma_map_page,
arch/blackfin/include/asm/dma-mapping.h +2 -2
@@ -36,9 +36,9 @@ _dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir)__dma_sync (addr, size, dir); } -extern struct dma_map_ops bfin_dma_ops; +extern const struct dma_map_ops bfin_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &bfin_dma_ops; }
arch/blackfin/kernel/dma-mapping.c +1 -1
@@ -159,7 +159,7 @@ static inline void bfin_dma_sync_single_for_device(struct device *dev,_dma_sync (handle, size, dir); } -struct dma_map_ops bfin_dma_ops = { +const struct dma_map_ops bfin_dma_ops = { .alloc = bfin_dma_alloc, .free = bfin_dma_free,
arch/c6x/include/asm/dma-mapping.h +2 -2
@@ -17,9 +17,9 @@*/ #define DMA_ERROR_CODE ~0 -extern struct dma_map_ops c6x_dma_ops; +extern const struct dma_map_ops c6x_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &c6x_dma_ops; }
arch/c6x/kernel/dma.c +1 -1
@@ -123,7 +123,7 @@ static void c6x_dma_sync_sg_for_device(struct device *dev, } -struct dma_map_ops c6x_dma_ops = { +const struct dma_map_ops c6x_dma_ops = { .alloc = c6x_dma_alloc, .free = c6x_dma_free, .map_page = c6x_dma_map_page,
arch/cris/arch-v32/drivers/pci/dma.c +1 -1
@@ -69,7 +69,7 @@ static inline int v32_dma_supported(struct device *dev, u64 mask)return 1 ; } -struct dma_map_ops v32_dma_ops = { +const struct dma_map_ops v32_dma_ops = { .alloc = v32_dma_alloc, .free = v32_dma_free, .map_page = v32_dma_map_page,
arch/cris/include/asm/dma-mapping.h +3 -3
@@ -2,14 +2,14 @@#define _ASM_CRIS_DMA_MAPPING_H#ifdef CONFIG_PCI -extern struct dma_map_ops v32_dma_ops; +extern const struct dma_map_ops v32_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &v32_dma_ops; }#else -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {BUG ();return NULL ;
arch/frv/include/asm/dma-mapping.h +2 -2
@@ -7,9 +7,9 @@extern unsigned long __nongprelbss dma_coherent_mem_start;extern unsigned long __nongprelbss dma_coherent_mem_end; -extern struct dma_map_ops frv_dma_ops; +extern const struct dma_map_ops frv_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &frv_dma_ops; }
arch/frv/mb93090-mb00/pci-dma-nommu.c +1 -1
@@ -164,7 +164,7 @@ static int frv_dma_supported(struct device *dev, u64 mask)return 1 ; } -struct dma_map_ops frv_dma_ops = { +const struct dma_map_ops frv_dma_ops = { .alloc = frv_dma_alloc, .free = frv_dma_free, .map_page = frv_dma_map_page,
arch/frv/mb93090-mb00/pci-dma.c +1 -1
@@ -106,7 +106,7 @@ static int frv_dma_supported(struct device *dev, u64 mask)return 1 ; } -struct dma_map_ops frv_dma_ops = { +const struct dma_map_ops frv_dma_ops = { .alloc = frv_dma_alloc, .free = frv_dma_free, .map_page = frv_dma_map_page,
arch/h8300/include/asm/dma-mapping.h +2 -2
@@ -1,9 +1,9 @@#ifndef _H8300_DMA_MAPPING_H#define _H8300_DMA_MAPPING_H -extern struct dma_map_ops h8300_dma_map_ops; +extern const struct dma_map_ops h8300_dma_map_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &h8300_dma_map_ops; }
arch/h8300/kernel/dma.c +1 -1
@@ -60,7 +60,7 @@ static int map_sg(struct device *dev, struct scatterlist *sgl,return nents; } -struct dma_map_ops h8300_dma_map_ops = { +const struct dma_map_ops h8300_dma_map_ops = { .alloc = dma_alloc, .free = dma_free, .map_page = map_page,
arch/hexagon/include/asm/dma-mapping.h +2 -2
@@ -32,9 +32,9 @@ struct device;extern int bad_dma_address;#define DMA_ERROR_CODE bad_dma_address -extern struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {if (unlikely (dev ==NULL ))return NULL ;
arch/hexagon/kernel/dma.c +2 -2
@@ -25,7 +25,7 @@#include <linux/module.h> #include <asm/page.h> -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;EXPORT_SYMBOL (dma_ops);int bad_dma_address;/* globals are automatically initialized to zero */
@@ -203,7 +203,7 @@ static void hexagon_sync_single_for_device(struct device *dev,dma_sync (dma_addr_to_virt (dma_handle), size, dir); } -struct dma_map_ops hexagon_dma_ops = { +const struct dma_map_ops hexagon_dma_ops = { .alloc = hexagon_dma_alloc_coherent, .free = hexagon_free_coherent, .map_sg = hexagon_map_sg,
arch/ia64/hp/common/hwsw_iommu.c +2 -2
@@ -18,7 +18,7 @@#include <linux/export.h> #include <asm/machvec.h> -extern struct dma_map_ops sba_dma_ops, swiotlb_dma_ops; +extern const struct dma_map_ops sba_dma_ops, swiotlb_dma_ops;/* swiotlb declarations & definitions: */ extern int swiotlb_late_init_with_default_size (size_t size);
@@ -34,7 +34,7 @@ static inline int use_swiotlb(struct device *dev) !sba_dma_ops.dma_supported (dev, *dev->dma_mask); } -struct dma_map_ops *hwsw_dma_get_ops (struct device *dev) +const struct dma_map_ops *hwsw_dma_get_ops (struct device *dev) {if (use_swiotlb (dev))return &swiotlb_dma_ops;
arch/ia64/hp/common/sba_iommu.c +2 -2
@@ -2096,7 +2096,7 @@ static int __init acpi_sba_ioc_init_acpi(void)/* This has to run before acpi_scan_init(). */ arch_initcall (acpi_sba_ioc_init_acpi); -extern struct dma_map_ops swiotlb_dma_ops; +extern const struct dma_map_ops swiotlb_dma_ops;static int __init sba_init (void )
@@ -2216,7 +2216,7 @@ sba_page_override(char *str)__setup ("sbapagesize=" ,sba_page_override); -struct dma_map_ops sba_dma_ops = { +const struct dma_map_ops sba_dma_ops = { .alloc = sba_alloc_coherent, .free = sba_free_coherent, .map_page = sba_map_page,
arch/ia64/include/asm/dma-mapping.h +1 -1
@@ -14,7 +14,7 @@#define DMA_ERROR_CODE 0 -extern struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *dma_ops;extern struct ia64_machine_vector ia64_mv;extern void set_iommu_machvec (void );
arch/ia64/include/asm/machvec.h +2 -2
@@ -44,7 +44,7 @@ typedef void ia64_mv_kernel_launch_event_t(void);/* DMA-mapping interface: */ typedef void ia64_mv_dma_init (void );typedef u64 ia64_mv_dma_get_required_mask (struct device *); -typedef struct dma_map_ops *ia64_mv_dma_get_ops (struct device *); +typedef const struct dma_map_ops *ia64_mv_dma_get_ops (struct device *);/* * WARNING: The legacy I/O space is _architected_. Platforms are
@@ -248,7 +248,7 @@ extern void machvec_init_from_cmdline(const char *cmdline);# endif /* CONFIG_IA64_GENERIC */ extern void swiotlb_dma_init (void ); -extern struct dma_map_ops *dma_get_ops (struct device *); +extern const struct dma_map_ops *dma_get_ops (struct device *);/* * Define default versions so we can extend machvec for new platforms without having
arch/ia64/kernel/dma-mapping.c +2 -2
@@ -4,7 +4,7 @@/* Set this to 1 if there is a HW IOMMU in the system */ int iommu_detected__read_mostly ; -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;EXPORT_SYMBOL (dma_ops);#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
@@ -17,7 +17,7 @@ static int __init dma_init(void) }fs_initcall (dma_init); -struct dma_map_ops *dma_get_ops (struct device *dev) +const struct dma_map_ops *dma_get_ops (struct device *dev) {return dma_ops; }
arch/ia64/kernel/pci-dma.c +5 -5
@@ -90,11 +90,11 @@ void __init pci_iommu_alloc(void) { dma_ops = &intel_dma_ops; - dma_ops->sync_single_for_cpu = machvec_dma_sync_single; - dma_ops->sync_sg_for_cpu = machvec_dma_sync_sg; - dma_ops->sync_single_for_device = machvec_dma_sync_single; - dma_ops->sync_sg_for_device = machvec_dma_sync_sg; - dma_ops->dma_supported = iommu_dma_supported; + intel_dma_ops.sync_single_for_cpu = machvec_dma_sync_single; + intel_dma_ops.sync_sg_for_cpu = machvec_dma_sync_sg; + intel_dma_ops.sync_single_for_device = machvec_dma_sync_single; + intel_dma_ops.sync_sg_for_device = machvec_dma_sync_sg; + intel_dma_ops.dma_supported = iommu_dma_supported;/* * The order of these functions is important for
arch/ia64/kernel/pci-swiotlb.c +1 -1
@@ -30,7 +30,7 @@ static void ia64_swiotlb_free_coherent(struct device *dev, size_t size,swiotlb_free_coherent (dev, size, vaddr, dma_addr); } -struct dma_map_ops swiotlb_dma_ops = { +const struct dma_map_ops swiotlb_dma_ops = { .alloc = ia64_swiotlb_alloc_coherent, .free = ia64_swiotlb_free_coherent, .map_page = swiotlb_map_page,
arch/m32r/include/asm/device.h +1 -1
@@ -4,7 +4,7 @@* This file is released under the GPLv2 */ struct dev_archdata { -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops; };struct pdev_archdata {
arch/m32r/include/asm/dma-mapping.h +1 -1
@@ -10,7 +10,7 @@#define DMA_ERROR_CODE (~(dma_addr_t)0x0) -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {if (dev && dev->archdata.dma_ops)return dev->archdata.dma_ops;
arch/m68k/include/asm/dma-mapping.h +2 -2
@@ -1,9 +1,9 @@#ifndef _M68K_DMA_MAPPING_H#define _M68K_DMA_MAPPING_H -extern struct dma_map_ops m68k_dma_ops; +extern const struct dma_map_ops m68k_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &m68k_dma_ops; }
arch/m68k/kernel/dma.c +1 -1
@@ -158,7 +158,7 @@ static int m68k_dma_map_sg(struct device *dev, struct scatterlist *sglist,return nents; } -struct dma_map_ops m68k_dma_ops = { +const struct dma_map_ops m68k_dma_ops = { .alloc = m68k_dma_alloc, .free = m68k_dma_free, .map_page = m68k_dma_map_page,
arch/metag/include/asm/dma-mapping.h +2 -2
@@ -1,9 +1,9 @@#ifndef _ASM_METAG_DMA_MAPPING_H#define _ASM_METAG_DMA_MAPPING_H -extern struct dma_map_ops metag_dma_ops; +extern const struct dma_map_ops metag_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &metag_dma_ops; }
arch/metag/kernel/dma.c +1 -1
@@ -575,7 +575,7 @@ static void metag_dma_sync_sg_for_device(struct device *dev,dma_sync_for_device (sg_virt (sg), sg->length, direction); } -struct dma_map_ops metag_dma_ops = { +const struct dma_map_ops metag_dma_ops = { .alloc = metag_dma_alloc, .free = metag_dma_free, .map_page = metag_dma_map_page,
arch/microblaze/include/asm/dma-mapping.h +2 -2
@@ -36,9 +36,9 @@/* * Available generic sets of operations */ -extern struct dma_map_ops dma_direct_ops; +extern const struct dma_map_ops dma_direct_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &dma_direct_ops; }
arch/microblaze/kernel/dma.c +1 -1
@@ -187,7 +187,7 @@ int dma_direct_mmap_coherent(struct device *dev, struct vm_area_struct *vma,#endif } -struct dma_map_ops dma_direct_ops = { +const struct dma_map_ops dma_direct_ops = { .alloc = dma_direct_alloc_coherent, .free = dma_direct_free_coherent, .mmap = dma_direct_mmap_coherent,
arch/mips/cavium-octeon/dma-octeon.c +2 -2
@@ -205,7 +205,7 @@ static phys_addr_t octeon_unity_dma_to_phys(struct device *dev, dma_addr_t daddr }struct octeon_dma_map_ops { -struct dma_map_ops dma_map_ops; +const struct dma_map_ops dma_map_ops;dma_addr_t (*phys_to_dma)(struct device *dev,phys_addr_t paddr);phys_addr_t (*dma_to_phys)(struct device *dev,dma_addr_t daddr); };
@@ -333,7 +333,7 @@ static struct octeon_dma_map_ops _octeon_pci_dma_map_ops = { }, }; -struct dma_map_ops *octeon_pci_dma_map_ops; +const struct dma_map_ops *octeon_pci_dma_map_ops;void __init octeon_pci_dma_init (void ) {
arch/mips/include/asm/device.h +1 -1
@@ -10,7 +10,7 @@ struct dma_map_ops;struct dev_archdata {/* DMA operations on that device */ -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;#ifdef CONFIG_DMA_PERDEV_COHERENT /* Non-zero if DMA is coherent with CPU caches */
arch/mips/include/asm/dma-mapping.h +2 -2
@@ -9,9 +9,9 @@#include <dma-coherence.h> #endif -extern struct dma_map_ops *mips_dma_map_ops; +extern const struct dma_map_ops *mips_dma_map_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {if (dev && dev->archdata.dma_ops)return dev->archdata.dma_ops;
arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h +1 -1
@@ -65,7 +65,7 @@ dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);phys_addr_t dma_to_phys (struct device *dev,dma_addr_t daddr);struct dma_map_ops ; -extern struct dma_map_ops *octeon_pci_dma_map_ops; +extern const struct dma_map_ops *octeon_pci_dma_map_ops;extern char *octeon_swiotlb;#endif /* __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H */
arch/mips/include/asm/netlogic/common.h +1 -1
@@ -88,7 +88,7 @@ extern struct plat_smp_ops nlm_smp_ops;extern char nlm_reset_entry[], nlm_reset_entry_end[];/* SWIOTLB */ -extern struct dma_map_ops nlm_swiotlb_dma_ops; +extern const struct dma_map_ops nlm_swiotlb_dma_ops;extern unsigned int nlm_threads_per_core;extern cpumask_t nlm_cpumask;
arch/mips/loongson64/common/dma-swiotlb.c +1 -1
@@ -122,7 +122,7 @@ phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)return daddr; } -static struct dma_map_ops loongson_dma_map_ops = { +static const struct dma_map_ops loongson_dma_map_ops = { .alloc = loongson_dma_alloc_coherent, .free = loongson_dma_free_coherent, .map_page = loongson_dma_map_page,
arch/mips/mm/dma-default.c +2 -2
@@ -417,7 +417,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,EXPORT_SYMBOL (dma_cache_sync); -static struct dma_map_ops mips_default_dma_map_ops = { +static const struct dma_map_ops mips_default_dma_map_ops = { .alloc = mips_dma_alloc_coherent, .free = mips_dma_free_coherent, .mmap = mips_dma_mmap,
@@ -433,7 +433,7 @@ static struct dma_map_ops mips_default_dma_map_ops = { .dma_supported = mips_dma_supported }; -struct dma_map_ops *mips_dma_map_ops = &mips_default_dma_map_ops; +const struct dma_map_ops *mips_dma_map_ops = &mips_default_dma_map_ops;EXPORT_SYMBOL (mips_dma_map_ops);#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
arch/mips/netlogic/common/nlm-dma.c +1 -1
@@ -67,7 +67,7 @@ static void nlm_dma_free_coherent(struct device *dev, size_t size,swiotlb_free_coherent (dev, size, vaddr, dma_handle); } -struct dma_map_ops nlm_swiotlb_dma_ops = { +const struct dma_map_ops nlm_swiotlb_dma_ops = { .alloc = nlm_dma_alloc_coherent, .free = nlm_dma_free_coherent, .map_page = swiotlb_map_page,
arch/mn10300/include/asm/dma-mapping.h +2 -2
@@ -14,9 +14,9 @@#include <asm/cache.h> #include <asm/io.h> -extern struct dma_map_ops mn10300_dma_ops; +extern const struct dma_map_ops mn10300_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &mn10300_dma_ops; }
arch/mn10300/mm/dma-alloc.c +1 -1
@@ -121,7 +121,7 @@ static int mn10300_dma_supported(struct device *dev, u64 mask)return 1 ; } -struct dma_map_ops mn10300_dma_ops = { +const struct dma_map_ops mn10300_dma_ops = { .alloc = mn10300_dma_alloc, .free = mn10300_dma_free, .map_page = mn10300_dma_map_page,
arch/nios2/include/asm/dma-mapping.h +2 -2
@@ -10,9 +10,9 @@#ifndef _ASM_NIOS2_DMA_MAPPING_H#define _ASM_NIOS2_DMA_MAPPING_H -extern struct dma_map_ops nios2_dma_ops; +extern const struct dma_map_ops nios2_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &nios2_dma_ops; }
arch/nios2/mm/dma-mapping.c +1 -1
@@ -192,7 +192,7 @@ static void nios2_dma_sync_sg_for_device(struct device *dev, } -struct dma_map_ops nios2_dma_ops = { +const struct dma_map_ops nios2_dma_ops = { .alloc = nios2_dma_alloc, .free = nios2_dma_free, .map_page = nios2_dma_map_page,
arch/openrisc/include/asm/dma-mapping.h +2 -2
@@ -28,9 +28,9 @@#define DMA_ERROR_CODE (~(dma_addr_t)0x0) -extern struct dma_map_ops or1k_dma_map_ops; +extern const struct dma_map_ops or1k_dma_map_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &or1k_dma_map_ops; }
arch/openrisc/kernel/dma.c +1 -1
@@ -232,7 +232,7 @@ or1k_sync_single_for_device(struct device *dev,mtspr (SPR_DCBFR , cl); } -struct dma_map_ops or1k_dma_map_ops = { +const struct dma_map_ops or1k_dma_map_ops = { .alloc = or1k_dma_alloc, .free = or1k_dma_free, .map_page = or1k_map_page,
arch/parisc/include/asm/dma-mapping.h +4 -4
@@ -21,13 +21,13 @@*/ #ifdef CONFIG_PA11 -extern struct dma_map_ops pcxl_dma_ops; -extern struct dma_map_ops pcx_dma_ops; +extern const struct dma_map_ops pcxl_dma_ops; +extern const struct dma_map_ops pcx_dma_ops;#endif -extern struct dma_map_ops *hppa_dma_ops; +extern const struct dma_map_ops *hppa_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return hppa_dma_ops; }
arch/parisc/kernel/drivers.c +1 -1
@@ -40,7 +40,7 @@#include <asm/parisc-device.h> /* See comments in include/asm-parisc/pci.h */ -struct dma_map_ops *hppa_dma_ops__read_mostly ; +const struct dma_map_ops *hppa_dma_ops__read_mostly ;EXPORT_SYMBOL (hppa_dma_ops);static struct device root = {
arch/parisc/kernel/pci-dma.c +2 -2
@@ -572,7 +572,7 @@ static void pa11_dma_sync_sg_for_device(struct device *dev, struct scatterlist *flush_kernel_vmap_range (sg_virt (sg), sg->length); } -struct dma_map_ops pcxl_dma_ops = { +const struct dma_map_ops pcxl_dma_ops = { .dma_supported = pa11_dma_supported, .alloc = pa11_dma_alloc, .free = pa11_dma_free,
@@ -608,7 +608,7 @@ static void pcx_dma_free(struct device *dev, size_t size, void *vaddr,return ; } -struct dma_map_ops pcx_dma_ops = { +const struct dma_map_ops pcx_dma_ops = { .dma_supported = pa11_dma_supported, .alloc = pcx_dma_alloc, .free = pcx_dma_free,
arch/powerpc/include/asm/device.h +1 -1
@@ -21,7 +21,7 @@ struct iommu_table;*/ struct dev_archdata {/* DMA operations on that device */ -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;/* * These two used to be a union. However, with the hybrid ops we need
arch/powerpc/include/asm/dma-mapping.h +3 -3
@@ -76,9 +76,9 @@ static inline unsigned long device_to_mask(struct device *dev)#ifdef CONFIG_PPC64 extern struct dma_map_ops dma_iommu_ops;#endif -extern struct dma_map_ops dma_direct_ops; +extern const struct dma_map_ops dma_direct_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {/* We don't handle the NULL dev case for ISA for now. We could * do it via an out of line call but it is not needed for now. The
@@ -91,7 +91,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)return dev->archdata.dma_ops; } -static inline void set_dma_ops (struct device *dev,struct dma_map_ops *ops) +static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) { dev->archdata.dma_ops = ops; }
arch/powerpc/include/asm/pci.h +2 -2
@@ -53,8 +53,8 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) }#ifdef CONFIG_PCI -extern void set_pci_dma_ops (struct dma_map_ops *dma_ops); -extern struct dma_map_ops *get_pci_dma_ops (void ); +extern void set_pci_dma_ops (const struct dma_map_ops *dma_ops); +extern const struct dma_map_ops *get_pci_dma_ops (void );#else /* CONFIG_PCI */ #define set_pci_dma_ops (d)#define get_pci_dma_ops () NULL
arch/powerpc/include/asm/swiotlb.h +1 -1
@@ -13,7 +13,7 @@#include <linux/swiotlb.h> -extern struct dma_map_ops swiotlb_dma_ops; +extern const struct dma_map_ops swiotlb_dma_ops;static inline void dma_mark_clean (void *addr,size_t size) {}
arch/powerpc/kernel/dma-swiotlb.c +1 -1
@@ -46,7 +46,7 @@ static u64 swiotlb_powerpc_get_required(struct device *dev)* map_page, and unmap_page on highmem, use normal dma_ops * for everything else. */ -struct dma_map_ops swiotlb_dma_ops = { +const struct dma_map_ops swiotlb_dma_ops = { .alloc = __dma_direct_alloc_coherent, .free = __dma_direct_free_coherent, .mmap = dma_direct_mmap_coherent,
arch/powerpc/kernel/dma.c +3 -3
@@ -274,7 +274,7 @@ static inline void dma_direct_sync_single(struct device *dev, }#endif -struct dma_map_ops dma_direct_ops = { +const struct dma_map_ops dma_direct_ops = { .alloc = dma_direct_alloc_coherent, .free = dma_direct_free_coherent, .mmap = dma_direct_mmap_coherent,
@@ -316,7 +316,7 @@ EXPORT_SYMBOL(dma_set_coherent_mask);int __dma_set_mask (struct device *dev,u64 dma_mask) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);if ((dma_ops !=NULL ) && (dma_ops->set_dma_mask !=NULL ))return dma_ops->set_dma_mask (dev, dma_mask);
@@ -344,7 +344,7 @@ EXPORT_SYMBOL(dma_set_mask);u64 __dma_get_required_mask (struct device *dev) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);if (unlikely (dma_ops ==NULL ))return 0 ;
arch/powerpc/kernel/pci-common.c +3 -3
@@ -59,14 +59,14 @@ resource_size_t isa_mem_base;EXPORT_SYMBOL (isa_mem_base); -static struct dma_map_ops *pci_dma_ops = &dma_direct_ops; +static const struct dma_map_ops *pci_dma_ops = &dma_direct_ops; -void set_pci_dma_ops (struct dma_map_ops *dma_ops) +void set_pci_dma_ops (const struct dma_map_ops *dma_ops) { pci_dma_ops = dma_ops; } -struct dma_map_ops *get_pci_dma_ops (void ) +const struct dma_map_ops *get_pci_dma_ops (void ) {return pci_dma_ops; }
arch/powerpc/platforms/cell/iommu.c +2 -2
@@ -651,7 +651,7 @@ static int dma_fixed_dma_supported(struct device *dev, u64 mask)static int dma_set_mask_and_switch (struct device *dev,u64 dma_mask); -static struct dma_map_ops dma_iommu_fixed_ops = { +static const struct dma_map_ops dma_iommu_fixed_ops = { .alloc = dma_fixed_alloc_coherent, .free = dma_fixed_free_coherent, .map_sg = dma_fixed_map_sg,
@@ -1172,7 +1172,7 @@ __setup("iommu_fixed=", setup_iommu_fixed);static u64 cell_dma_get_required_mask (struct device *dev) { -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;if (!dev->dma_mask)return 0 ;
arch/powerpc/platforms/powernv/npu-dma.c +1 -1
@@ -115,7 +115,7 @@ static u64 dma_npu_get_required_mask(struct device *dev)return 0 ; } -static struct dma_map_ops dma_npu_ops = { +static const struct dma_map_ops dma_npu_ops = { .map_page = dma_npu_map_page, .map_sg = dma_npu_map_sg, .alloc = dma_npu_alloc,
arch/powerpc/platforms/ps3/system-bus.c +2 -2
@@ -701,7 +701,7 @@ static u64 ps3_dma_get_required_mask(struct device *_dev)return DMA_BIT_MASK (32 ); } -static struct dma_map_ops ps3_sb_dma_ops = { +static const struct dma_map_ops ps3_sb_dma_ops = { .alloc = ps3_alloc_coherent, .free = ps3_free_coherent, .map_sg = ps3_sb_map_sg,
@@ -712,7 +712,7 @@ static struct dma_map_ops ps3_sb_dma_ops = { .unmap_page = ps3_unmap_page, }; -static struct dma_map_ops ps3_ioc0_dma_ops = { +static const struct dma_map_ops ps3_ioc0_dma_ops = { .alloc = ps3_alloc_coherent, .free = ps3_free_coherent, .map_sg = ps3_ioc0_map_sg,
arch/powerpc/platforms/pseries/ibmebus.c +1 -1
@@ -136,7 +136,7 @@ static u64 ibmebus_dma_get_required_mask(struct device *dev)return DMA_BIT_MASK (64 ); } -static struct dma_map_ops ibmebus_dma_ops = { +static const struct dma_map_ops ibmebus_dma_ops = { .alloc = ibmebus_alloc_coherent, .free = ibmebus_free_coherent, .map_sg = ibmebus_map_sg,
arch/powerpc/platforms/pseries/vio.c +1 -1
@@ -615,7 +615,7 @@ static u64 vio_dma_get_required_mask(struct device *dev)return dma_iommu_ops.get_required_mask (dev); } -static struct dma_map_ops vio_dma_mapping_ops = { +static const struct dma_map_ops vio_dma_mapping_ops = { .alloc = vio_dma_iommu_alloc_coherent, .free = vio_dma_iommu_free_coherent, .mmap = dma_direct_mmap_coherent,
arch/s390/include/asm/device.h +1 -1
@@ -4,7 +4,7 @@* This file is released under the GPLv2 */ struct dev_archdata { -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops; };struct pdev_archdata {
arch/s390/include/asm/dma-mapping.h +2 -2
@@ -10,9 +10,9 @@#define DMA_ERROR_CODE (~(dma_addr_t) 0x0) -extern struct dma_map_ops s390_pci_dma_ops; +extern const struct dma_map_ops s390_pci_dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {if (dev && dev->archdata.dma_ops)return dev->archdata.dma_ops;
arch/s390/pci/pci_dma.c +1 -1
@@ -650,7 +650,7 @@ static int __init dma_debug_do_init(void) }fs_initcall (dma_debug_do_init); -struct dma_map_ops s390_pci_dma_ops = { +const struct dma_map_ops s390_pci_dma_ops = { .alloc = s390_dma_alloc, .free = s390_dma_free, .map_sg = s390_dma_map_sg,
arch/sh/include/asm/dma-mapping.h +2 -2
@@ -1,10 +1,10 @@#ifndef __ASM_SH_DMA_MAPPING_H#define __ASM_SH_DMA_MAPPING_H -extern struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *dma_ops;extern void no_iommu_init (void ); -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return dma_ops; }
arch/sh/kernel/dma-nommu.c +1 -1
@@ -65,7 +65,7 @@ static void nommu_sync_sg(struct device *dev, struct scatterlist *sg, }#endif -struct dma_map_ops nommu_dma_ops = { +const struct dma_map_ops nommu_dma_ops = { .alloc = dma_generic_alloc_coherent, .free = dma_generic_free_coherent, .map_page = nommu_map_page,
arch/sh/mm/consistent.c +1 -1
@@ -22,7 +22,7 @@#define PREALLOC_DMA_DEBUG_ENTRIES 4096 -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;EXPORT_SYMBOL (dma_ops);static int __init dma_init (void )
arch/sparc/include/asm/dma-mapping.h +4 -4
@@ -18,13 +18,13 @@ static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,*/ } -extern struct dma_map_ops *dma_ops; -extern struct dma_map_ops *leon_dma_ops; -extern struct dma_map_ops pci32_dma_ops; +extern const struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *leon_dma_ops; +extern const struct dma_map_ops pci32_dma_ops;extern struct bus_type pci_bus_type; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {#ifdef CONFIG_SPARC_LEON if (sparc_cpu_model == sparc_leon)
arch/sparc/kernel/iommu.c +2 -2
@@ -741,7 +741,7 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev,spin_unlock_irqrestore (&iommu->lock, flags); } -static struct dma_map_ops sun4u_dma_ops = { +static const struct dma_map_ops sun4u_dma_ops = { .alloc = dma_4u_alloc_coherent, .free = dma_4u_free_coherent, .map_page = dma_4u_map_page,
@@ -752,7 +752,7 @@ static struct dma_map_ops sun4u_dma_ops = { .sync_sg_for_cpu = dma_4u_sync_sg_for_cpu, }; -struct dma_map_ops *dma_ops = &sun4u_dma_ops; +const struct dma_map_ops *dma_ops = &sun4u_dma_ops;EXPORT_SYMBOL (dma_ops);int dma_supported (struct device *dev,u64 device_mask)
arch/sparc/kernel/ioport.c +4 -4
@@ -401,7 +401,7 @@ static void sbus_sync_sg_for_device(struct device *dev, struct scatterlist *sg,BUG (); } -static struct dma_map_ops sbus_dma_ops = { +static const struct dma_map_ops sbus_dma_ops = { .alloc = sbus_alloc_coherent, .free = sbus_free_coherent, .map_page = sbus_map_page,
@@ -637,7 +637,7 @@ static void pci32_sync_sg_for_device(struct device *device, struct scatterlist * } } -struct dma_map_ops pci32_dma_ops = { +const struct dma_map_ops pci32_dma_ops = { .alloc = pci32_alloc_coherent, .free = pci32_free_coherent, .map_page = pci32_map_page,
@@ -652,10 +652,10 @@ struct dma_map_ops pci32_dma_ops = {EXPORT_SYMBOL (pci32_dma_ops);/* leon re-uses pci32_dma_ops */ -struct dma_map_ops *leon_dma_ops = &pci32_dma_ops; +const struct dma_map_ops *leon_dma_ops = &pci32_dma_ops;EXPORT_SYMBOL (leon_dma_ops); -struct dma_map_ops *dma_ops = &sbus_dma_ops; +const struct dma_map_ops *dma_ops = &sbus_dma_ops;EXPORT_SYMBOL (dma_ops);
arch/sparc/kernel/pci_sun4v.c +1 -1
@@ -669,7 +669,7 @@ static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,local_irq_restore (flags); } -static struct dma_map_ops sun4v_dma_ops = { +static const struct dma_map_ops sun4v_dma_ops = { .alloc = dma_4v_alloc_coherent, .free = dma_4v_free_coherent, .map_page = dma_4v_map_page,
arch/tile/include/asm/device.h +1 -1
@@ -18,7 +18,7 @@struct dev_archdata {/* DMA operations on that device */ -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;/* Offset of the DMA address from the PA. */ dma_addr_t dma_offset;
arch/tile/include/asm/dma-mapping.h +6 -6
@@ -24,12 +24,12 @@#define ARCH_HAS_DMA_GET_REQUIRED_MASK #endif -extern struct dma_map_ops *tile_dma_map_ops; -extern struct dma_map_ops *gx_pci_dma_map_ops; -extern struct dma_map_ops *gx_legacy_pci_dma_map_ops; -extern struct dma_map_ops *gx_hybrid_pci_dma_map_ops; +extern const struct dma_map_ops *tile_dma_map_ops; +extern const struct dma_map_ops *gx_pci_dma_map_ops; +extern const struct dma_map_ops *gx_legacy_pci_dma_map_ops; +extern const struct dma_map_ops *gx_hybrid_pci_dma_map_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {if (dev && dev->archdata.dma_ops)return dev->archdata.dma_ops;
@@ -59,7 +59,7 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)static inline void dma_mark_clean (void *addr,size_t size) {} -static inline void set_dma_ops (struct device *dev,struct dma_map_ops *ops) +static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) { dev->archdata.dma_ops = ops; }
arch/tile/kernel/pci-dma.c +12 -12
@@ -329,7 +329,7 @@ tile_dma_supported(struct device *dev, u64 mask)return 1 ; } -static struct dma_map_ops tile_default_dma_map_ops = { +static const struct dma_map_ops tile_default_dma_map_ops = { .alloc = tile_dma_alloc_coherent, .free = tile_dma_free_coherent, .map_page = tile_dma_map_page,
@@ -344,7 +344,7 @@ static struct dma_map_ops tile_default_dma_map_ops = { .dma_supported = tile_dma_supported }; -struct dma_map_ops *tile_dma_map_ops = &tile_default_dma_map_ops; +const struct dma_map_ops *tile_dma_map_ops = &tile_default_dma_map_ops;EXPORT_SYMBOL (tile_dma_map_ops);/* Generic PCI DMA mapping functions */
@@ -516,7 +516,7 @@ tile_pci_dma_supported(struct device *dev, u64 mask)return 1 ; } -static struct dma_map_ops tile_pci_default_dma_map_ops = { +static const struct dma_map_ops tile_pci_default_dma_map_ops = { .alloc = tile_pci_dma_alloc_coherent, .free = tile_pci_dma_free_coherent, .map_page = tile_pci_dma_map_page,
@@ -531,7 +531,7 @@ static struct dma_map_ops tile_pci_default_dma_map_ops = { .dma_supported = tile_pci_dma_supported }; -struct dma_map_ops *gx_pci_dma_map_ops = &tile_pci_default_dma_map_ops; +const struct dma_map_ops *gx_pci_dma_map_ops = &tile_pci_default_dma_map_ops;EXPORT_SYMBOL (gx_pci_dma_map_ops);/* PCI DMA mapping functions for legacy PCI devices */
@@ -552,7 +552,7 @@ static void tile_swiotlb_free_coherent(struct device *dev, size_t size,swiotlb_free_coherent (dev, size, vaddr, dma_addr); } -static struct dma_map_ops pci_swiotlb_dma_ops = { +static const struct dma_map_ops pci_swiotlb_dma_ops = { .alloc = tile_swiotlb_alloc_coherent, .free = tile_swiotlb_free_coherent, .map_page = swiotlb_map_page,
@@ -567,7 +567,7 @@ static struct dma_map_ops pci_swiotlb_dma_ops = { .mapping_error = swiotlb_dma_mapping_error, }; -static struct dma_map_ops pci_hybrid_dma_ops = { +static const struct dma_map_ops pci_hybrid_dma_ops = { .alloc = tile_swiotlb_alloc_coherent, .free = tile_swiotlb_free_coherent, .map_page = tile_pci_dma_map_page,
@@ -582,18 +582,18 @@ static struct dma_map_ops pci_hybrid_dma_ops = { .dma_supported = tile_pci_dma_supported }; -struct dma_map_ops *gx_legacy_pci_dma_map_ops = &pci_swiotlb_dma_ops; -struct dma_map_ops *gx_hybrid_pci_dma_map_ops = &pci_hybrid_dma_ops; +const struct dma_map_ops *gx_legacy_pci_dma_map_ops = &pci_swiotlb_dma_ops; +const struct dma_map_ops *gx_hybrid_pci_dma_map_ops = &pci_hybrid_dma_ops;#else -struct dma_map_ops *gx_legacy_pci_dma_map_ops; -struct dma_map_ops *gx_hybrid_pci_dma_map_ops; +const struct dma_map_ops *gx_legacy_pci_dma_map_ops; +const struct dma_map_ops *gx_hybrid_pci_dma_map_ops;#endif EXPORT_SYMBOL (gx_legacy_pci_dma_map_ops);EXPORT_SYMBOL (gx_hybrid_pci_dma_map_ops);int dma_set_mask (struct device *dev,u64 mask) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);/* * For PCI devices with 64-bit DMA addressing capability, promote
@@ -623,7 +623,7 @@ EXPORT_SYMBOL(dma_set_mask);#ifdef CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK int dma_set_coherent_mask (struct device *dev,u64 mask) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);/* * For PCI devices with 64-bit DMA addressing capability, promote
arch/unicore32/include/asm/dma-mapping.h +2 -2
@@ -21,9 +21,9 @@#include <asm/memory.h> #include <asm/cacheflush.h> -extern struct dma_map_ops swiotlb_dma_map_ops; +extern const struct dma_map_ops swiotlb_dma_map_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {return &swiotlb_dma_map_ops; }
arch/unicore32/mm/dma-swiotlb.c +1 -1
@@ -31,7 +31,7 @@ static void unicore_swiotlb_free_coherent(struct device *dev, size_t size,swiotlb_free_coherent (dev, size, vaddr, dma_addr); } -struct dma_map_ops swiotlb_dma_map_ops = { +const struct dma_map_ops swiotlb_dma_map_ops = { .alloc = unicore_swiotlb_alloc_coherent, .free = unicore_swiotlb_free_coherent, .map_sg = swiotlb_map_sg_attrs,
arch/x86/include/asm/device.h +2 -2
@@ -3,7 +3,7 @@struct dev_archdata {#ifdef CONFIG_X86_DEV_DMA_OPS -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;#endif #if defined(CONFIG_INTEL_IOMMU ) || defined(CONFIG_AMD_IOMMU )void *iommu;/* hook for IOMMU specific extension */
@@ -13,7 +13,7 @@ struct dev_archdata {#if defined(CONFIG_X86_DEV_DMA_OPS ) && defined(CONFIG_PCI_DOMAINS )struct dma_domain {struct list_head node; -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;int domain_nr; };void add_dma_domain (struct dma_domain *domain);
arch/x86/include/asm/dma-mapping.h +2 -2
@@ -25,9 +25,9 @@ extern int iommu_merge;extern struct device x86_dma_fallback_dev;extern int panic_on_overflow; -extern struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {#ifndef CONFIG_X86_DEV_DMA_OPS return dma_ops;
arch/x86/include/asm/iommu.h +1 -1
@@ -1,7 +1,7 @@#ifndef _ASM_X86_IOMMU_H#define _ASM_X86_IOMMU_H -extern struct dma_map_ops nommu_dma_ops; +extern const struct dma_map_ops nommu_dma_ops;extern int force_iommu, no_iommu;extern int iommu_detected;extern int iommu_pass_through;
arch/x86/kernel/amd_gart_64.c +1 -1
@@ -695,7 +695,7 @@ static __init int init_amd_gatt(struct agp_kern_info *info)return -1 ; } -static struct dma_map_ops gart_dma_ops = { +static const struct dma_map_ops gart_dma_ops = { .map_sg = gart_map_sg, .unmap_sg = gart_unmap_sg, .map_page = gart_map_page,
arch/x86/kernel/pci-calgary_64.c +1 -1
@@ -478,7 +478,7 @@ static void calgary_free_coherent(struct device *dev, size_t size,free_pages ((unsigned long )vaddr,get_order (size)); } -static struct dma_map_ops calgary_dma_ops = { +static const struct dma_map_ops calgary_dma_ops = { .alloc = calgary_alloc_coherent, .free = calgary_free_coherent, .map_sg = calgary_map_sg,
arch/x86/kernel/pci-dma.c +2 -2
@@ -17,7 +17,7 @@static int forbid_dac__read_mostly ; -struct dma_map_ops *dma_ops = &nommu_dma_ops; +const struct dma_map_ops *dma_ops = &nommu_dma_ops;EXPORT_SYMBOL (dma_ops);static int iommu_sac_force__read_mostly ;
@@ -214,7 +214,7 @@ early_param("iommu", iommu_setup);int dma_supported (struct device *dev,u64 mask) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);#ifdef CONFIG_PCI if (mask >0xffffffff && forbid_dac >0 ) {
arch/x86/kernel/pci-nommu.c +1 -1
@@ -88,7 +88,7 @@ static void nommu_sync_sg_for_device(struct device *dev,flush_write_buffers (); } -struct dma_map_ops nommu_dma_ops = { +const struct dma_map_ops nommu_dma_ops = { .alloc = dma_generic_alloc_coherent, .free = dma_generic_free_coherent, .map_sg = nommu_map_sg,
arch/x86/kernel/pci-swiotlb.c +1 -1
@@ -45,7 +45,7 @@ void x86_swiotlb_free_coherent(struct device *dev, size_t size,dma_generic_free_coherent (dev, size, vaddr, dma_addr, attrs); } -static struct dma_map_ops swiotlb_dma_ops = { +static const struct dma_map_ops swiotlb_dma_ops = { .mapping_error = swiotlb_dma_mapping_error, .alloc = x86_swiotlb_alloc_coherent, .free = x86_swiotlb_free_coherent,
arch/x86/pci/sta2x11-fixup.c +1 -1
@@ -179,7 +179,7 @@ static void *sta2x11_swiotlb_alloc_coherent(struct device *dev, }/* We have our own dma_ops: the same as swiotlb but from alloc (above) */ -static struct dma_map_ops sta2x11_dma_ops = { +static const struct dma_map_ops sta2x11_dma_ops = { .alloc = sta2x11_swiotlb_alloc_coherent, .free = x86_swiotlb_free_coherent, .map_page = swiotlb_map_page,
arch/x86/xen/pci-swiotlb-xen.c +1 -1
@@ -18,7 +18,7 @@int xen_swiotlb__read_mostly ; -static struct dma_map_ops xen_swiotlb_dma_ops = { +static const struct dma_map_ops xen_swiotlb_dma_ops = { .alloc = xen_swiotlb_alloc_coherent, .free = xen_swiotlb_free_coherent, .sync_single_for_cpu = xen_swiotlb_sync_single_for_cpu,
arch/xtensa/include/asm/device.h +1 -1
@@ -10,7 +10,7 @@ struct dma_map_ops;struct dev_archdata {/* DMA operations on that device */ -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops; };struct pdev_archdata {
arch/xtensa/include/asm/dma-mapping.h +2 -2
@@ -18,9 +18,9 @@#define DMA_ERROR_CODE (~(dma_addr_t)0x0) -extern struct dma_map_ops xtensa_dma_map_ops; +extern const struct dma_map_ops xtensa_dma_map_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {if (dev && dev->archdata.dma_ops)return dev->archdata.dma_ops;
arch/xtensa/kernel/pci-dma.c +1 -1
@@ -249,7 +249,7 @@ int xtensa_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)return 0 ; } -struct dma_map_ops xtensa_dma_map_ops = { +const struct dma_map_ops xtensa_dma_map_ops = { .alloc = xtensa_dma_alloc, .free = xtensa_dma_free, .map_page = xtensa_map_page,
drivers/iommu/amd_iommu.c +2 -2
@@ -117,7 +117,7 @@ static const struct iommu_ops amd_iommu_ops;static ATOMIC_NOTIFIER_HEAD (ppr_notifier);int amd_iommu_max_glx_val =-1 ; -static struct dma_map_ops amd_iommu_dma_ops; +static const struct dma_map_ops amd_iommu_dma_ops;/* * This struct contains device specific data for the IOMMU
@@ -2728,7 +2728,7 @@ static int amd_iommu_dma_supported(struct device *dev, u64 mask)return check_device (dev); } -static struct dma_map_ops amd_iommu_dma_ops = { +static const struct dma_map_ops amd_iommu_dma_ops = { .alloc = alloc_coherent, .free = free_coherent, .map_page = map_page,
drivers/misc/mic/bus/mic_bus.c +1 -1
@@ -143,7 +143,7 @@ static void mbus_release_dev(struct device *d) }struct mbus_device * -mbus_register_device (struct device *pdev,int id,struct dma_map_ops *dma_ops, +mbus_register_device (struct device *pdev,int id,const struct dma_map_ops *dma_ops,struct mbus_hw_ops *hw_ops,int index,void __iomem *mmio_va) {
drivers/misc/mic/bus/scif_bus.c +1 -1
@@ -138,7 +138,7 @@ static void scif_release_dev(struct device *d) }struct scif_hw_dev * -scif_register_device(struct device *pdev, int id, struct dma_map_ops *dma_ops, +scif_register_device(struct device *pdev, int id, const struct dma_map_ops *dma_ops, struct scif_hw_ops *hw_ops, u8 dnode, u8 snode, struct mic_mw *mmio, struct mic_mw *aper, void *dp, void __iomem *rdp, struct dma_chan **chan, int num_chan,
drivers/misc/mic/bus/scif_bus.h +1 -1
@@ -113,7 +113,7 @@ int scif_register_driver(struct scif_driver *driver);void scif_unregister_driver (struct scif_driver *driver);struct scif_hw_dev * scif_register_device(struct device *pdev, int id, - struct dma_map_ops *dma_ops, + const struct dma_map_ops *dma_ops, struct scif_hw_ops *hw_ops, u8 dnode, u8 snode, struct mic_mw *mmio, struct mic_mw *aper, void *dp, void __iomem *rdp,
drivers/misc/mic/bus/vop_bus.c +1 -1
@@ -154,7 +154,7 @@ vop_register_device(struct device *pdev, int id, vdev->dev.parent = pdev; vdev->id.device = id; vdev->id.vendor =VOP_DEV_ANY_ID ; - vdev->dev.archdata.dma_ops = (struct dma_map_ops *)dma_ops; + vdev->dev.archdata.dma_ops = dma_ops; vdev->dev.dma_mask = &vdev->dev.coherent_dma_mask;dma_set_mask (&vdev->dev,DMA_BIT_MASK (64 )); vdev->dev.release = vop_release_dev;
drivers/misc/mic/host/mic_boot.c +2 -2
@@ -245,7 +245,7 @@ static void __mic_dma_unmap_sg(struct device *dev,dma_unmap_sg (&mdev->pdev->dev, sg, nents, dir); } -static struct dma_map_ops __mic_dma_ops = { +static const struct dma_map_ops __mic_dma_ops = { .alloc = __mic_dma_alloc, .free = __mic_dma_free, .map_page = __mic_dma_map_page,
@@ -344,7 +344,7 @@ mic_dma_unmap_page(struct device *dev, dma_addr_t dma_addr,mic_unmap_single (mdev, dma_addr, size); } -static struct dma_map_ops mic_dma_ops = { +static const struct dma_map_ops mic_dma_ops = { .map_page = mic_dma_map_page, .unmap_page = mic_dma_unmap_page, };
drivers/parisc/ccio-dma.c +1 -1
@@ -1011,7 +1011,7 @@ ccio_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents,DBG_RUN_SG ("%s() DONE (nents %d)\n" , __func__, nents); } -static struct dma_map_ops ccio_ops = { +static const struct dma_map_ops ccio_ops = { .dma_supported = ccio_dma_supported, .alloc = ccio_alloc, .free = ccio_free,
drivers/parisc/sba_iommu.c +1 -1
@@ -1069,7 +1069,7 @@ sba_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, } -static struct dma_map_ops sba_ops = { +static const struct dma_map_ops sba_ops = { .dma_supported = sba_dma_supported, .alloc = sba_alloc, .free = sba_free,
drivers/pci/host/vmd.c +1 -1
@@ -282,7 +282,7 @@ static struct device *to_vmd_dev(struct device *dev)return &vmd->dev->dev; } -static struct dma_map_ops *vmd_dma_ops (struct device *dev) +static const struct dma_map_ops *vmd_dma_ops (struct device *dev) {return get_dma_ops (to_vmd_dev (dev)); }
include/linux/dma-mapping.h +21 -21
162 lines not on this page · raw message
include/linux/mic_bus.h +1 -1
@@ -90,7 +90,7 @@ struct mbus_hw_ops { };struct mbus_device * -mbus_register_device (struct device *pdev,int id,struct dma_map_ops *dma_ops, +mbus_register_device (struct device *pdev,int id,const struct dma_map_ops *dma_ops,struct mbus_hw_ops *hw_ops,int index,void __iomem *mmio_va);void mbus_unregister_device (struct mbus_device *mbdev);
include/xen/arm/hypervisor.h +1 -1
@@ -18,7 +18,7 @@ static inline enum paravirt_lazy_mode paravirt_get_lazy_mode(void)return PARAVIRT_LAZY_NONE ; } -extern struct dma_map_ops *xen_dma_ops; +extern const struct dma_map_ops *xen_dma_ops;#ifdef CONFIG_XEN void __init xen_early_init (void );
lib/dma-noop.c +1 -1
@@ -64,7 +64,7 @@ static int dma_noop_supported(struct device *dev, u64 mask)return 1 ; } -struct dma_map_ops dma_noop_ops = { +const struct dma_map_ops dma_noop_ops = { .alloc = dma_noop_alloc, .free = dma_noop_free, .map_page = dma_noop_map_page,
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 2/37 treewide: Move dma_ops from struct dev_archdata into struct device
In reply to Bart Van AsscheSome but not all architectures provide set_dma_ops(). Move dma_ops from struct dev_archdata into struct device such that it becomes possible on all architectures to configure dma_ops per device.
--- arch/arm/include/asm/device.h | 1 - arch/arm/include/asm/dma-mapping.h | 6 +++--- arch/arm64/include/asm/device.h | 1 - arch/arm64/include/asm/dma-mapping.h | 4 ++-- arch/arm64/mm/dma-mapping.c | 8 ++++---- arch/m32r/include/asm/device.h | 1 - arch/m32r/include/asm/dma-mapping.h | 4 ++-- arch/mips/include/asm/device.h | 5 ----- arch/mips/include/asm/dma-mapping.h | 4 ++-- arch/mips/pci/pci-octeon.c | 2 +- arch/powerpc/include/asm/device.h | 4 ---- arch/powerpc/include/asm/dma-mapping.h | 4 ++-- arch/powerpc/kernel/dma.c | 2 +- arch/powerpc/platforms/cell/iommu.c | 2 +- arch/powerpc/platforms/pasemi/iommu.c | 2 +- arch/powerpc/platforms/pasemi/setup.c | 2 +- arch/powerpc/platforms/ps3/system-bus.c | 4 ++-- arch/powerpc/platforms/pseries/ibmebus.c | 2 +- arch/s390/include/asm/device.h | 1 - arch/s390/include/asm/dma-mapping.h | 4 ++-- arch/s390/pci/pci.c | 2 +- arch/tile/include/asm/device.h | 3 --- arch/tile/include/asm/dma-mapping.h | 6 +++--- arch/x86/include/asm/device.h | 3 --- arch/x86/include/asm/dma-mapping.h | 4 ++-- arch/x86/kernel/pci-calgary_64.c | 4 ++-- arch/x86/pci/common.c | 2 +- arch/x86/pci/sta2x11-fixup.c | 8 ++++---- arch/xtensa/include/asm/device.h | 4 ---- arch/xtensa/include/asm/dma-mapping.h | 4 ++-- drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +- drivers/iommu/amd_iommu.c | 6 +++--- drivers/misc/mic/bus/mic_bus.c | 2 +- drivers/misc/mic/bus/scif_bus.c | 2 +- drivers/misc/mic/bus/vop_bus.c | 2 +- include/linux/device.h | 1 + 36 files changed, 48 insertions(+), 70 deletions(-)
arch/arm/include/asm/device.h +0 -1
@@ -7,7 +7,6 @@#define ASMARM_DEVICE_H struct dev_archdata { -const struct dma_map_ops *dma_ops;#ifdef CONFIG_DMABOUNCE struct dmabounce_device_info *dmabounce;#endif
arch/arm/include/asm/dma-mapping.h +3 -3
@@ -18,8 +18,8 @@ extern const struct dma_map_ops arm_coherent_dma_ops;static inline const struct dma_map_ops *__generic_dma_ops (struct device *dev) { -if (dev && dev->archdata.dma_ops) -return dev->archdata.dma_ops; +if (dev && dev->dma_ops) +return dev->dma_ops;return &arm_dma_ops; }
@@ -34,7 +34,7 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) {BUG_ON (!dev); - dev->archdata.dma_ops = ops; + dev->dma_ops = ops; }#define HAVE_ARCH_DMA_SUPPORTED 1
arch/arm64/include/asm/device.h +0 -1
@@ -17,7 +17,6 @@#define __ASM_DEVICE_Hstruct dev_archdata { -const struct dma_map_ops *dma_ops;#ifdef CONFIG_IOMMU_API void *iommu;/* private IOMMU data */ #endif
arch/arm64/include/asm/dma-mapping.h +2 -2
@@ -29,8 +29,8 @@ extern const struct dma_map_ops dummy_dma_ops;static inline const struct dma_map_ops *__generic_dma_ops (struct device *dev) { -if (dev && dev->archdata.dma_ops) -return dev->archdata.dma_ops; +if (dev && dev->dma_ops) +return dev->dma_ops;/* * We expect no ISA devices, and all other DMA masters are expected to
arch/arm64/mm/dma-mapping.c +4 -4
@@ -837,7 +837,7 @@ static bool do_iommu_attach(struct device *dev, const struct iommu_ops *ops,return false; } - dev->archdata.dma_ops = &iommu_dma_ops; + dev->dma_ops = &iommu_dma_ops;return true; }
@@ -941,7 +941,7 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,void arch_teardown_dma_ops (struct device *dev) { - dev->archdata.dma_ops =NULL ; + dev->dma_ops =NULL ; }#else
@@ -955,8 +955,8 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,void arch_setup_dma_ops (struct device *dev,u64 dma_base,u64 size,const struct iommu_ops *iommu,bool coherent) { -if (!dev->archdata.dma_ops) - dev->archdata.dma_ops = &swiotlb_dma_ops; +if (!dev->dma_ops) + dev->dma_ops = &swiotlb_dma_ops; dev->archdata.dma_coherent = coherent;__iommu_setup_dma_ops (dev, dma_base, size, iommu);
arch/m32r/include/asm/device.h +0 -1
@@ -4,7 +4,6 @@* This file is released under the GPLv2 */ struct dev_archdata { -const struct dma_map_ops *dma_ops; };struct pdev_archdata {
arch/m32r/include/asm/dma-mapping.h +2 -2
@@ -12,8 +12,8 @@static inline const struct dma_map_ops *get_dma_ops (struct device *dev) { -if (dev && dev->archdata.dma_ops) -return dev->archdata.dma_ops; +if (dev && dev->dma_ops) +return dev->dma_ops;return &dma_noop_ops; }
arch/mips/include/asm/device.h +0 -5
@@ -6,12 +6,7 @@ #ifndef _ASM_MIPS_DEVICE_H #define _ASM_MIPS_DEVICE_H -struct dma_map_ops; - struct dev_archdata { - /* DMA operations on that device */ - const struct dma_map_ops *dma_ops; - #ifdef CONFIG_DMA_PERDEV_COHERENT /* Non-zero if DMA is coherent with CPU caches */ bool dma_coherent;
arch/mips/include/asm/dma-mapping.h +2 -2
@@ -13,8 +13,8 @@ extern const struct dma_map_ops *mips_dma_map_ops;static inline const struct dma_map_ops *get_dma_ops (struct device *dev) { -if (dev && dev->archdata.dma_ops) -return dev->archdata.dma_ops; +if (dev && dev->dma_ops) +return dev->dma_ops;else return mips_dma_map_ops; }
arch/mips/pci/pci-octeon.c +1 -1
@@ -167,7 +167,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)pci_write_config_dword (dev, pos +PCI_ERR_ROOT_STATUS , dconfig); } - dev->dev.archdata.dma_ops = octeon_pci_dma_map_ops; + dev->dev.dma_ops = octeon_pci_dma_map_ops;return 0 ; }
arch/powerpc/include/asm/device.h +0 -4
@@ -6,7 +6,6 @@#ifndef _ASM_POWERPC_DEVICE_H#define _ASM_POWERPC_DEVICE_H -struct dma_map_ops ;struct device_node ;#ifdef CONFIG_PPC64 struct pci_dn ;
@@ -20,9 +19,6 @@ struct iommu_table;* drivers/macintosh/macio_asic.c */ struct dev_archdata { -/* DMA operations on that device */ -const struct dma_map_ops *dma_ops; -/* * These two used to be a union. However, with the hybrid ops we need * both so here we store both a DMA offset for direct mappings and
arch/powerpc/include/asm/dma-mapping.h +2 -2
@@ -88,12 +88,12 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)if (unlikely (dev ==NULL ))return NULL ; -return dev->archdata.dma_ops; +return dev->dma_ops; }static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) { - dev->archdata.dma_ops = ops; + dev->dma_ops = ops; }/*
arch/powerpc/kernel/dma.c +1 -1
@@ -33,7 +33,7 @@ static u64 __maybe_unused get_pfn_limit(struct device *dev)struct dev_archdata __maybe_unused *sd = &dev->archdata;#ifdef CONFIG_SWIOTLB -if (sd->max_direct_dma_addr && sd->dma_ops == &swiotlb_dma_ops) +if (sd->max_direct_dma_addr && dev->dma_ops == &swiotlb_dma_ops) pfn =min_t (u64, pfn, sd->max_direct_dma_addr >>PAGE_SHIFT );#endif
arch/powerpc/platforms/cell/iommu.c +1 -1
@@ -692,7 +692,7 @@ static int cell_of_bus_notify(struct notifier_block *nb, unsigned long action,return 0 ;/* We use the PCI DMA ops */ - dev->archdata.dma_ops =get_pci_dma_ops (); + dev->dma_ops =get_pci_dma_ops ();cell_dma_dev_setup (dev);
arch/powerpc/platforms/pasemi/iommu.c +1 -1
@@ -186,7 +186,7 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev)*/ if (dev->vendor ==0x1959 && dev->device ==0xa007 && !firmware_has_feature (FW_FEATURE_LPAR )) { - dev->dev.archdata.dma_ops = &dma_direct_ops; + dev->dev.dma_ops = &dma_direct_ops;/* * Set the coherent DMA mask to prevent the iommu * being used unnecessarily
arch/powerpc/platforms/pasemi/setup.c +1 -1
@@ -363,7 +363,7 @@ static int pcmcia_notify(struct notifier_block *nb, unsigned long action,return 0 ;/* We use the direct ops for localbus */ - dev->archdata.dma_ops = &dma_direct_ops; + dev->dma_ops = &dma_direct_ops;return 0 ; }
arch/powerpc/platforms/ps3/system-bus.c +2 -2
@@ -756,11 +756,11 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev)switch (dev->dev_type) {case PS3_DEVICE_TYPE_IOC0 : - dev->core.archdata.dma_ops = &ps3_ioc0_dma_ops; + dev->core.dma_ops = &ps3_ioc0_dma_ops;dev_set_name (&dev->core,"ioc0_%02x" , ++dev_ioc0_count);break ;case PS3_DEVICE_TYPE_SB : - dev->core.archdata.dma_ops = &ps3_sb_dma_ops; + dev->core.dma_ops = &ps3_sb_dma_ops;dev_set_name (&dev->core,"sb_%02x" , ++dev_sb_count);break ;
arch/powerpc/platforms/pseries/ibmebus.c +1 -1
@@ -169,7 +169,7 @@ static int ibmebus_create_device(struct device_node *dn)return -ENOMEM ; dev->dev.bus = &ibmebus_bus_type; - dev->dev.archdata.dma_ops = &ibmebus_dma_ops; + dev->dev.dma_ops = &ibmebus_dma_ops; ret =of_device_add (dev);if (ret)
arch/s390/include/asm/device.h +0 -1
@@ -4,7 +4,6 @@* This file is released under the GPLv2 */ struct dev_archdata { -const struct dma_map_ops *dma_ops; };struct pdev_archdata {
arch/s390/include/asm/dma-mapping.h +2 -2
@@ -14,8 +14,8 @@ extern const struct dma_map_ops s390_pci_dma_ops;static inline const struct dma_map_ops *get_dma_ops (struct device *dev) { -if (dev && dev->archdata.dma_ops) -return dev->archdata.dma_ops; +if (dev && dev->dma_ops) +return dev->dma_ops;return &dma_noop_ops; }
arch/s390/pci/pci.c +1 -1
@@ -641,7 +641,7 @@ int pcibios_add_device(struct pci_dev *pdev)int i; pdev->dev.groups = zpci_attr_groups; - pdev->dev.archdata.dma_ops = &s390_pci_dma_ops; + pdev->dev.dma_ops = &s390_pci_dma_ops;zpci_map_resources (pdev);for (i =0 ; i <PCI_BAR_COUNT ; i++) {
arch/tile/include/asm/device.h +0 -3
@@ -17,9 +17,6 @@#define _ASM_TILE_DEVICE_Hstruct dev_archdata { -/* DMA operations on that device */ -const struct dma_map_ops *dma_ops; -/* Offset of the DMA address from the PA. */ dma_addr_t dma_offset;
arch/tile/include/asm/dma-mapping.h +3 -3
@@ -31,8 +31,8 @@ extern const struct dma_map_ops *gx_hybrid_pci_dma_map_ops;static inline const struct dma_map_ops *get_dma_ops (struct device *dev) { -if (dev && dev->archdata.dma_ops) -return dev->archdata.dma_ops; +if (dev && dev->dma_ops) +return dev->dma_ops;else return tile_dma_map_ops; }
@@ -61,7 +61,7 @@ static inline void dma_mark_clean(void *addr, size_t size) {}static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) { - dev->archdata.dma_ops = ops; + dev->dma_ops = ops; }static inline bool dma_capable (struct device *dev,dma_addr_t addr,size_t size)
arch/x86/include/asm/device.h +0 -3
@@ -2,9 +2,6 @@#define _ASM_X86_DEVICE_Hstruct dev_archdata { -#ifdef CONFIG_X86_DEV_DMA_OPS -const struct dma_map_ops *dma_ops; -#endif #if defined(CONFIG_INTEL_IOMMU ) || defined(CONFIG_AMD_IOMMU )void *iommu;/* hook for IOMMU specific extension */ #endif
arch/x86/include/asm/dma-mapping.h +2 -2
@@ -32,10 +32,10 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)#ifndef CONFIG_X86_DEV_DMA_OPS return dma_ops;#else -if (unlikely (!dev) || !dev->archdata.dma_ops) +if (unlikely (!dev) || !dev->dma_ops)return dma_ops;else -return dev->archdata.dma_ops; +return dev->dma_ops;#endif }
arch/x86/kernel/pci-calgary_64.c +2 -2
@@ -1177,7 +1177,7 @@ static int __init calgary_init(void) tbl =find_iommu_table (&dev->dev);if (translation_enabled (tbl)) - dev->dev.archdata.dma_ops = &calgary_dma_ops; + dev->dev.dma_ops = &calgary_dma_ops; }return ret;
@@ -1201,7 +1201,7 @@ static int __init calgary_init(void)calgary_disable_translation (dev);calgary_free_bus (dev);pci_dev_put (dev);/* Undo calgary_init_one()'s pci_dev_get() */ - dev->dev.archdata.dma_ops =NULL ; + dev->dev.dma_ops =NULL ; }while (1 );return ret;
arch/x86/pci/common.c +1 -1
@@ -667,7 +667,7 @@ static void set_dma_domain_ops(struct pci_dev *pdev)spin_lock (&dma_domain_list_lock);list_for_each_entry (domain, &dma_domain_list, node) {if (pci_domain_nr (pdev->bus) == domain->domain_nr) { - pdev->dev.archdata.dma_ops = domain->dma_ops; + pdev->dev.dma_ops = domain->dma_ops;break ; } }
arch/x86/pci/sta2x11-fixup.c +4 -4
@@ -203,7 +203,7 @@ static void sta2x11_setup_pdev(struct pci_dev *pdev)return ;pci_set_consistent_dma_mask (pdev,STA2X11_AMBA_SIZE -1 );pci_set_dma_mask (pdev,STA2X11_AMBA_SIZE -1 ); - pdev->dev.archdata.dma_ops = &sta2x11_dma_ops; + pdev->dev.dma_ops = &sta2x11_dma_ops;/* We must enable all devices as master, for audio DMA to work */ pci_set_master (pdev);
@@ -223,7 +223,7 @@ bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) {struct sta2x11_mapping *map; -if (dev->archdata.dma_ops != &sta2x11_dma_ops) { +if (dev->dma_ops != &sta2x11_dma_ops) {if (!dev->dma_mask)return false;return addr + size -1 <= *dev->dma_mask;
@@ -247,7 +247,7 @@ bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)*/ dma_addr_t phys_to_dma (struct device *dev,phys_addr_t paddr) { -if (dev->archdata.dma_ops != &sta2x11_dma_ops) +if (dev->dma_ops != &sta2x11_dma_ops)return paddr;return p2a (paddr,to_pci_dev (dev)); }
@@ -259,7 +259,7 @@ dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)*/ phys_addr_t dma_to_phys (struct device *dev,dma_addr_t daddr) { -if (dev->archdata.dma_ops != &sta2x11_dma_ops) +if (dev->dma_ops != &sta2x11_dma_ops)return daddr;return a2p (daddr,to_pci_dev (dev)); }
arch/xtensa/include/asm/device.h +0 -4
@@ -6,11 +6,7 @@#ifndef _ASM_XTENSA_DEVICE_H#define _ASM_XTENSA_DEVICE_H -struct dma_map_ops ; -struct dev_archdata { -/* DMA operations on that device */ -const struct dma_map_ops *dma_ops; }; struct pdev_archdata {
arch/xtensa/include/asm/dma-mapping.h +2 -2
@@ -22,8 +22,8 @@ extern const struct dma_map_ops xtensa_dma_map_ops;static inline const struct dma_map_ops *get_dma_ops (struct device *dev) { -if (dev && dev->archdata.dma_ops) -return dev->archdata.dma_ops; +if (dev && dev->dma_ops) +return dev->dma_ops;else return &xtensa_dma_map_ops; }
drivers/infiniband/ulp/srpt/ib_srpt.c +1 -1
@@ -2465,7 +2465,7 @@ static void srpt_add_one(struct ib_device *device)int i;pr_debug ("device = %p, device->dma_ops = %p\n" , device, - device->dma_ops); + device->dma_device->dma_ops); sdev =kzalloc (sizeof (*sdev),GFP_KERNEL );if (!sdev)
drivers/iommu/amd_iommu.c +3 -3
@@ -515,7 +515,7 @@ static void iommu_uninit_device(struct device *dev)iommu_group_remove_device (dev);/* Remove dma-ops */ - dev->archdata.dma_ops =NULL ; + dev->dma_ops =NULL ;/* * We keep dev_data around for unplugged devices and reuse it when the
@@ -2164,7 +2164,7 @@ static int amd_iommu_add_device(struct device *dev) dev_name(dev));iommu_ignore_device (dev); - dev->archdata.dma_ops = &nommu_dma_ops; + dev->dma_ops = &nommu_dma_ops; goto out; }init_iommu_group (dev);
@@ -2181,7 +2181,7 @@ static int amd_iommu_add_device(struct device *dev)if (domain->type ==IOMMU_DOMAIN_IDENTITY ) dev_data->passthrough = true;else - dev->archdata.dma_ops = &amd_iommu_dma_ops; + dev->dma_ops = &amd_iommu_dma_ops; out:iommu_completion_wait (iommu);
drivers/misc/mic/bus/mic_bus.c +1 -1
@@ -158,7 +158,7 @@ mbus_register_device(struct device *pdev, int id, const struct dma_map_ops *dma_ mbdev->dev.parent = pdev; mbdev->id.device = id; mbdev->id.vendor =MBUS_DEV_ANY_ID ; - mbdev->dev.archdata.dma_ops = dma_ops; + mbdev->dev.dma_ops = dma_ops; mbdev->dev.dma_mask = &mbdev->dev.coherent_dma_mask;dma_set_mask (&mbdev->dev,DMA_BIT_MASK (64 )); mbdev->dev.release = mbus_release_dev;
drivers/misc/mic/bus/scif_bus.c +1 -1
@@ -154,7 +154,7 @@ scif_register_device(struct device *pdev, int id, const struct dma_map_ops *dma_ sdev->dev.parent = pdev; sdev->id.device = id; sdev->id.vendor =SCIF_DEV_ANY_ID ; - sdev->dev.archdata.dma_ops = dma_ops; + sdev->dev.dma_ops = dma_ops; sdev->dev.release = scif_release_dev; sdev->hw_ops = hw_ops; sdev->dnode = dnode;
drivers/misc/mic/bus/vop_bus.c +1 -1
@@ -154,7 +154,7 @@ vop_register_device(struct device *pdev, int id, vdev->dev.parent = pdev; vdev->id.device = id; vdev->id.vendor =VOP_DEV_ANY_ID ; - vdev->dev.archdata.dma_ops = dma_ops; + vdev->dev.dma_ops = dma_ops; vdev->dev.dma_mask = &vdev->dev.coherent_dma_mask;dma_set_mask (&vdev->dev,DMA_BIT_MASK (64 )); vdev->dev.release = vop_release_dev;
include/linux/device.h +1 -0
@@ -921,6 +921,7 @@ struct device {#ifdef CONFIG_NUMA int numa_node;/* NUMA node this device is close to */ #endif +const struct dma_map_ops *dma_ops;u64 *dma_mask;/* dma mask (if dma'able device) */ u64 coherent_dma_mask;/* Like dma_mask, but for alloc_coherent mappings as
Signature · 1 line
2.11.0
PATCH v3 3/37 treewide: Consolidate set_dma_ops() implementations
In reply to Bart Van AsscheNow that all set_dma_ops() implementations are identical (ignoring BUG_ON() statements), remove the architecture specific definitions and add a definition in <linux/dma-mapping.h>.
--- arch/arm/include/asm/dma-mapping.h | 6 ------ arch/powerpc/include/asm/dma-mapping.h | 5 ----- arch/tile/include/asm/dma-mapping.h | 5 ----- include/linux/dma-mapping.h | 5 +++++ 4 files changed, 5 insertions(+), 16 deletions(-)
arch/arm/include/asm/dma-mapping.h +0 -6
@@ -31,12 +31,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)return __generic_dma_ops (dev); } -static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) -{ -BUG_ON (!dev); - dev->dma_ops = ops; -} -#define HAVE_ARCH_DMA_SUPPORTED 1extern int dma_supported (struct device *dev,u64 mask);
arch/powerpc/include/asm/dma-mapping.h +0 -5
@@ -91,11 +91,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)return dev->dma_ops; } -static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) -{ - dev->dma_ops = ops; -} -/* * get_dma_offset() *
arch/tile/include/asm/dma-mapping.h +0 -5
@@ -59,11 +59,6 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)static inline void dma_mark_clean (void *addr,size_t size) {} -static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) -{ - dev->dma_ops = ops; -} -static inline bool dma_capable (struct device *dev,dma_addr_t addr,size_t size) {if (!dev->dma_mask)
include/linux/dma-mapping.h +5 -0
@@ -164,6 +164,11 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,#ifdef CONFIG_HAS_DMA #include <asm/dma-mapping.h> +static inline void set_dma_ops (struct device *dev, +const struct dma_map_ops *dma_ops) +{ + dev->dma_ops = dma_ops; +}#else /* * Define the dma api to allow compilation but not linking of
Signature · 1 line
2.11.0
Re: [PATCH v3 03/37] treewide: Consolidate set_dma_ops() implementations
Quoted 4 lines · Bart Van Assche
Now that all
set_dma_ops()implementations are identical (ignoringBUG_ON()statements), remove the architecture specific definitions and add a definition in <linux/dma-mapping.h>.
Quoted 10 lines
Signed-off-by Bart Van Assche <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc Chris Metcalf <[email protected]>Cc David Woodhouse <[email protected]>Cc linux-arch at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgCc linux-kernel at vger.kernel.orgCc linuxppc-dev at lists.ozlabs.orgCc Paul Mackerras <[email protected]>Cc Russell King <[email protected]>
Thanks.
Quoted 75 lines
--- arch/arm/include/asm/dma-mapping.h | 6 ------ arch/powerpc/include/asm/dma-mapping.h | 5 ----- arch/tile/include/asm/dma-mapping.h | 5 ----- include/linux/dma-mapping.h | 5 +++++ 4 files changed, 5 insertions(+), 16 deletions(-)arch/arm/include/asm/dma-mapping.h +0
-6@@ -31,12 +31,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)return __generic_dma_ops (dev); } -static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) -{ -BUG_ON (!dev); - dev->dma_ops = ops; -} -#define HAVE_ARCH_DMA_SUPPORTED 1extern int dma_supported (struct device *dev,u64 mask);arch/powerpc/include/asm/dma-mapping.h +0
-5@@ -91,11 +91,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)return dev->dma_ops; } -static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) -{ - dev->dma_ops = ops; -} -/* * get_dma_offset() * arch/tile/include/asm/dma-mapping.h +0
-5@@ -59,11 +59,6 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)static inline void dma_mark_clean (void *addr,size_t size) {} -static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) -{ - dev->dma_ops = ops; -} -static inline bool dma_capable (struct device *dev,dma_addr_t addr,size_t size) {if (!dev->dma_mask)include/linux/dma-mapping.h +5
-0@@ -164,6 +164,11 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,#ifdef CONFIG_HAS_DMA #include <asm/dma-mapping.h> +static inline void set_dma_ops (struct device *dev, +const struct dma_map_ops *dma_ops) +{ + dev->dma_ops = dma_ops; +}#else /* * Define the dma api to allow compilation but not linking of Signature · 1 line
2.11.0
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.
PATCH v3 4/37 treewide: Consolidate get_dma_ops() implementations
In reply to Bart Van AsscheIntroduce a new architecture-specific get_arch_dma_ops() function that takes a struct bus_type * argument. Add get_dma_ops() in <linux/dma-mapping.h>.
--- arch/alpha/include/asm/dma-mapping.h | 2 +- arch/arc/include/asm/dma-mapping.h | 2 +- arch/arm/include/asm/dma-mapping.h | 4 ++-- arch/arm64/include/asm/dma-mapping.h | 4 ++-- arch/avr32/include/asm/dma-mapping.h | 2 +- arch/blackfin/include/asm/dma-mapping.h | 2 +- arch/c6x/include/asm/dma-mapping.h | 2 +- arch/cris/include/asm/dma-mapping.h | 4 ++-- arch/frv/include/asm/dma-mapping.h | 2 +- arch/h8300/include/asm/dma-mapping.h | 2 +- arch/hexagon/include/asm/dma-mapping.h | 5 +---- arch/ia64/include/asm/dma-mapping.h | 5 ++++- arch/m32r/include/asm/dma-mapping.h | 4 +--- arch/m68k/include/asm/dma-mapping.h | 2 +- arch/metag/include/asm/dma-mapping.h | 2 +- arch/microblaze/include/asm/dma-mapping.h | 2 +- arch/mips/include/asm/dma-mapping.h | 7 ++----- arch/mn10300/include/asm/dma-mapping.h | 2 +- arch/nios2/include/asm/dma-mapping.h | 2 +- arch/openrisc/include/asm/dma-mapping.h | 2 +- arch/parisc/include/asm/dma-mapping.h | 2 +- arch/powerpc/include/asm/dma-mapping.h | 7 ++----- arch/powerpc/include/asm/ps3.h | 2 +- arch/s390/include/asm/dma-mapping.h | 4 +--- arch/sh/include/asm/dma-mapping.h | 2 +- arch/sparc/include/asm/dma-mapping.h | 4 ++-- arch/tile/include/asm/dma-mapping.h | 7 ++----- arch/unicore32/include/asm/dma-mapping.h | 2 +- arch/x86/include/asm/dma-mapping.h | 9 +-------- arch/xtensa/include/asm/dma-mapping.h | 7 ++----- include/linux/dma-mapping.h | 7 +++++++ 31 files changed, 48 insertions(+), 64 deletions(-)
arch/alpha/include/asm/dma-mapping.h +1 -1
@@ -3,7 +3,7 @@extern const struct dma_map_ops *dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return dma_ops; }
arch/arc/include/asm/dma-mapping.h +1 -1
@@ -20,7 +20,7 @@extern const struct dma_map_ops arc_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &arc_dma_ops; }
arch/arm/include/asm/dma-mapping.h +2 -2
@@ -23,12 +23,12 @@ static inline const struct dma_map_ops *__generic_dma_ops(struct device *dev)return &arm_dma_ops; } -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {if (xen_initial_domain ())return xen_dma_ops;else -return __generic_dma_ops (dev); +return __generic_dma_ops (NULL ); }#define HAVE_ARCH_DMA_SUPPORTED 1
arch/arm64/include/asm/dma-mapping.h +2 -2
@@ -39,12 +39,12 @@ static inline const struct dma_map_ops *__generic_dma_ops(struct device *dev)return &dummy_dma_ops; } -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {if (xen_initial_domain ())return xen_dma_ops;else -return __generic_dma_ops (dev); +return __generic_dma_ops (NULL ); } void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
arch/avr32/include/asm/dma-mapping.h +1 -1
@@ -6,7 +6,7 @@ extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,extern const struct dma_map_ops avr32_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &avr32_dma_ops; }
arch/blackfin/include/asm/dma-mapping.h +1 -1
@@ -38,7 +38,7 @@ _dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir)extern const struct dma_map_ops bfin_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &bfin_dma_ops; }
arch/c6x/include/asm/dma-mapping.h +1 -1
@@ -19,7 +19,7 @@extern const struct dma_map_ops c6x_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &c6x_dma_ops; }
arch/cris/include/asm/dma-mapping.h +2 -2
@@ -4,12 +4,12 @@#ifdef CONFIG_PCI extern const struct dma_map_ops v32_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &v32_dma_ops; }#else -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {BUG ();return NULL ;
arch/frv/include/asm/dma-mapping.h +1 -1
@@ -9,7 +9,7 @@ extern unsigned long __nongprelbss dma_coherent_mem_end;extern const struct dma_map_ops frv_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &frv_dma_ops; }
arch/h8300/include/asm/dma-mapping.h +1 -1
@@ -3,7 +3,7 @@extern const struct dma_map_ops h8300_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &h8300_dma_map_ops; }
arch/hexagon/include/asm/dma-mapping.h +1 -4
@@ -34,11 +34,8 @@ extern int bad_dma_address;extern const struct dma_map_ops *dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) { -if (unlikely (dev ==NULL )) -return NULL ; -return dma_ops; }
arch/ia64/include/asm/dma-mapping.h +4 -1
@@ -23,7 +23,10 @@ extern void machvec_dma_sync_single(struct device *, dma_addr_t, size_t,extern void machvec_dma_sync_sg (struct device *,struct scatterlist *,int ,enum dma_data_direction ); -#define get_dma_ops (dev) platform_dma_get_ops(dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) +{ +return platform_dma_get_ops (NULL ); +}static inline bool dma_capable (struct device *dev,dma_addr_t addr,size_t size) {
arch/m32r/include/asm/dma-mapping.h +1 -3
@@ -10,10 +10,8 @@#define DMA_ERROR_CODE (~(dma_addr_t)0x0) -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) { -if (dev && dev->dma_ops) -return dev->dma_ops;return &dma_noop_ops; }
arch/m68k/include/asm/dma-mapping.h +1 -1
@@ -3,7 +3,7 @@extern const struct dma_map_ops m68k_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &m68k_dma_ops; }
arch/metag/include/asm/dma-mapping.h +1 -1
@@ -3,7 +3,7 @@extern const struct dma_map_ops metag_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &metag_dma_ops; }
arch/microblaze/include/asm/dma-mapping.h +1 -1
@@ -38,7 +38,7 @@*/ extern const struct dma_map_ops dma_direct_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &dma_direct_ops; }
arch/mips/include/asm/dma-mapping.h +2 -5
@@ -11,12 +11,9 @@extern const struct dma_map_ops *mips_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) { -if (dev && dev->dma_ops) -return dev->dma_ops; -else -return mips_dma_map_ops; +return mips_dma_map_ops; }static inline bool dma_capable (struct device *dev,dma_addr_t addr,size_t size)
arch/mn10300/include/asm/dma-mapping.h +1 -1
@@ -16,7 +16,7 @@extern const struct dma_map_ops mn10300_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &mn10300_dma_ops; }
arch/nios2/include/asm/dma-mapping.h +1 -1
@@ -12,7 +12,7 @@extern const struct dma_map_ops nios2_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &nios2_dma_ops; }
arch/openrisc/include/asm/dma-mapping.h +1 -1
@@ -30,7 +30,7 @@extern const struct dma_map_ops or1k_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &or1k_dma_map_ops; }
arch/parisc/include/asm/dma-mapping.h +1 -1
@@ -27,7 +27,7 @@ extern const struct dma_map_ops pcx_dma_ops;extern const struct dma_map_ops *hppa_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return hppa_dma_ops; }
arch/powerpc/include/asm/dma-mapping.h +2 -5
@@ -78,17 +78,14 @@ extern struct dma_map_ops dma_iommu_ops;#endif extern const struct dma_map_ops dma_direct_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {/* We don't handle the NULL dev case for ISA for now. We could * do it via an out of line call but it is not needed for now. The * only ISA DMA device we support is the floppy and we have a hack * in the floppy driver directly to get a device for us. */ -if (unlikely (dev ==NULL )) -return NULL ; - -return dev->dma_ops; +return NULL ; }/*
arch/powerpc/include/asm/ps3.h +1 -1
@@ -435,7 +435,7 @@ static inline void *ps3_system_bus_get_drvdata(return dev_get_drvdata (&dev->core); } -/* These two need global scope for get_dma_ops(). */ +/* These two need global scope for get_arch_dma_ops(). */ extern struct bus_type ps3_system_bus_type;
arch/s390/include/asm/dma-mapping.h +1 -3
@@ -12,10 +12,8 @@extern const struct dma_map_ops s390_pci_dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) { -if (dev && dev->dma_ops) -return dev->dma_ops;return &dma_noop_ops; }
arch/sh/include/asm/dma-mapping.h +1 -1
@@ -4,7 +4,7 @@extern const struct dma_map_ops *dma_ops;extern void no_iommu_init (void ); -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return dma_ops; }
arch/sparc/include/asm/dma-mapping.h +2 -2
@@ -24,14 +24,14 @@ extern const struct dma_map_ops pci32_dma_ops;extern struct bus_type pci_bus_type; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {#ifdef CONFIG_SPARC_LEON if (sparc_cpu_model == sparc_leon)return leon_dma_ops;#endif #if defined(CONFIG_SPARC32 ) && defined(CONFIG_PCI ) -if (dev->bus == &pci_bus_type) +if (bus == &pci_bus_type)return &pci32_dma_ops;#endif return dma_ops;
arch/tile/include/asm/dma-mapping.h +2 -5
@@ -29,12 +29,9 @@ extern const struct dma_map_ops *gx_pci_dma_map_ops;extern const struct dma_map_ops *gx_legacy_pci_dma_map_ops;extern const struct dma_map_ops *gx_hybrid_pci_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) { -if (dev && dev->dma_ops) -return dev->dma_ops; -else -return tile_dma_map_ops; +return tile_dma_map_ops; }static inline dma_addr_t get_dma_offset (struct device *dev)
arch/unicore32/include/asm/dma-mapping.h +1 -1
@@ -23,7 +23,7 @@extern const struct dma_map_ops swiotlb_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) {return &swiotlb_dma_map_ops; }
arch/x86/include/asm/dma-mapping.h +1 -8
@@ -27,16 +27,9 @@ extern int panic_on_overflow;extern const struct dma_map_ops *dma_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) { -#ifndef CONFIG_X86_DEV_DMA_OPS return dma_ops; -#else -if (unlikely (!dev) || !dev->dma_ops) -return dma_ops; -else -return dev->dma_ops; -#endif }bool arch_dma_alloc_attrs (struct device **dev,gfp_t *gfp);
arch/xtensa/include/asm/dma-mapping.h +2 -5
@@ -20,12 +20,9 @@extern const struct dma_map_ops xtensa_dma_map_ops; -static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_arch_dma_ops (struct bus_type *bus) { -if (dev && dev->dma_ops) -return dev->dma_ops; -else -return &xtensa_dma_map_ops; +return &xtensa_dma_map_ops; } void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
include/linux/dma-mapping.h +7 -0
@@ -164,6 +164,13 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,#ifdef CONFIG_HAS_DMA #include <asm/dma-mapping.h> +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) +{ +if (dev && dev->dma_ops) +return dev->dma_ops; +return get_arch_dma_ops (dev ? dev->bus :NULL ); +} +static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *dma_ops) {
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-1-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
PATCH v3 5/37 lib/dma-noop: Clarify a comment
The next patch in this series will introduce another set of DMA operations that map 1:1 with memory. Clarify that dma-noop maps to physical addresses.
--- lib/dma-noop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/dma-noop.c +1 -1
@@ -1,7 +1,7 @@/* * lib/dma-noop.c * -* Simple DMA noop-ops that map 1:1 with memory +* DMA operations that map to physical addresses without flushing memory. */ #include <linux/export.h> #include <linux/mm.h>
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 6/37 lib/dma-noop: Only build dma_noop_ops for s390 and m32r
In reply to a message not in the archiveReduce the kernel size by only building dma_noop_ops for those architectures that actually use it. This was suggested by Christoph Hellwig.
--- arch/m32r/Kconfig | 1 + arch/s390/Kconfig | 1 + lib/Kconfig | 5 +++++ lib/Makefile | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-)
arch/m32r/Kconfig +1 -0
@@ -18,6 +18,7 @@ config M32R select MODULES_USE_ELF_RELA select HAVE_DEBUG_STACKOVERFLOW select CPU_NO_EFFICIENT_FFS + select DMA_NOOP_OPS config SBUS bool
arch/s390/Kconfig +1 -0
@@ -137,6 +137,7 @@ config S390 select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_API_DEBUG select HAVE_DMA_CONTIGUOUS + select DMA_NOOP_OPS select HAVE_DYNAMIC_FTRACE select HAVE_DYNAMIC_FTRACE_WITH_REGS select HAVE_EFFICIENT_UNALIGNED_ACCESS
lib/Kconfig +5 -0
@@ -395,6 +395,11 @@ config HAS_DMA depends on !NO_DMA default y +config DMA_NOOP_OPS + bool + depends on HAS_DMA && (!64BIT || ARCH_DMA_ADDR_T_64BIT) + default n + config CHECK_SIGNATURE bool
lib/Makefile +1 -1
@@ -26,7 +26,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \ lib-$(CONFIG_MMU) += ioremap.o lib-$(CONFIG_SMP) += cpumask.o -lib-$(CONFIG_HAS_DMA) += dma-noop.o +lib-$(CONFIG_DMA_NOOP_OPS) += dma-noop.o lib-y += kobject.o klist.o obj-y += lockref.o
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 7/37 lib/dma-virt: Add dma_virt_ops
In reply to a message not in the archiveSeveral RDMA drivers (hfi1, qib and rxe) expect that ib_sge.addr is a virtual address. Provide DMA mapping operations that are suitable for these drivers.
--- include/linux/dma-mapping.h | 1 + lib/Kconfig | 5 ++++ lib/Makefile | 1 + lib/dma-virt.c | 72 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 lib/dma-virt.c
include/linux/dma-mapping.h +1 -0
@@ -128,6 +128,7 @@ struct dma_map_ops { };extern const struct dma_map_ops dma_noop_ops; +extern const struct dma_map_ops dma_virt_ops;#define DMA_BIT_MASK (n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
lib/Kconfig +5 -0
@@ -400,6 +400,11 @@ config DMA_NOOP_OPS depends on HAS_DMA && (!64BIT || ARCH_DMA_ADDR_T_64BIT) default n +config DMA_VIRT_OPS + bool + depends on HAS_DMA && (!64BIT || ARCH_DMA_ADDR_T_64BIT) + default n + config CHECK_SIGNATURE bool
lib/Makefile +1 -0
@@ -27,6 +27,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \ lib-$(CONFIG_MMU) += ioremap.o lib-$(CONFIG_SMP) += cpumask.o lib-$(CONFIG_DMA_NOOP_OPS) += dma-noop.o +lib-$(CONFIG_DMA_VIRT_OPS) += dma-virt.o lib-y += kobject.o klist.o obj-y += lockref.o
lib/dma-virt.c new file +72 -0
72 lines not on this page · raw message
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-8-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Re: [PATCH v3 07/37] lib/dma-virt: Add dma_virt_ops
lib/dma-virt.c line 19
Quoted 9 lines · Bart Van Assche
lib/dma-virt.c new file +9
-0+static void *dma_virt_alloc (struct device *dev,size_t size, +dma_addr_t *dma_handle,gfp_t gfp, +unsigned long attrs) +{ +void *ret; + + ret = (void *)__get_free_pages (gfp,get_order (size)); +if (ret) + *dma_handle = (uintptr_t )ret;
Why do you cast to uintptr_t everywhere in this patch before assigning to a dma_addr_t when you can cast directly to dma_addr_t?
Joerg
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH v3 07/37] lib/dma-virt: Add dma_virt_ops
Quoted 13 lines · Joerg Roedel
lib/dma-virt.c line 19
Quoted 9 lines · Bart Van Assche
lib/dma-virt.c new file +9
-0+static void *dma_virt_alloc (struct device *dev,size_t size, +dma_addr_t *dma_handle,gfp_t gfp, +unsigned long attrs) +{ +void *ret; + + ret = (void *)__get_free_pages (gfp,get_order (size)); +if (ret) + *dma_handle = (uintptr_t )ret;Why do you cast to
uintptr_teverywhere in this patch before assigning to adma_addr_twhen you can cast directly todma_addr_t?
Hello Joerg,
There is at least one Linux architecture for which pointers are 64 bits wide and dma_addr_t is 32 bits wide. As you know casting a 64-bit pointer to a 32-bit integer type triggers a compiler warning. That's why I used uintptr_t instead of dma_addr_t.
Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 8/37 IB/core: Remove ib_dma_*map_single_attrs()
In reply to a message not in the archiveRemove these functions because these are not used. Additionally, the implementation of these functions is not correct for the hfi1, qib and rxe drivers because dma_device is used instead of dma_ops.
--- include/rdma/ib_verbs.h | 18 ------------------ 1 file changed, 18 deletions(-)
include/rdma/ib_verbs.h +0 -18
@@ -3004,24 +3004,6 @@ static inline void ib_dma_unmap_single(struct ib_device *dev,dma_unmap_single (dev->dma_device, addr, size, direction); } -static inline u64 ib_dma_map_single_attrs (struct ib_device *dev, -void *cpu_addr,size_t size, -enum dma_data_direction direction, -unsigned long dma_attrs) -{ -return dma_map_single_attrs (dev->dma_device, cpu_addr, size, - direction, dma_attrs); -} - -static inline void ib_dma_unmap_single_attrs (struct ib_device *dev, -u64 addr,size_t size, -enum dma_data_direction direction, -unsigned long dma_attrs) -{ -return dma_unmap_single_attrs (dev->dma_device, addr, size, - direction, dma_attrs); -} -/** * ib_dma_map_page - Map a physical page to DMA address * @dev: The device for which the dma_addr is to be created
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 9/37 RDS: IB: Remove an unused structure member
In reply to a message not in the archive--- net/rds/ib_mr.h | 1 - 1 file changed, 1 deletion(-)
net/rds/ib_mr.h +0 -1
@@ -45,7 +45,6 @@struct rds_ib_fmr {struct ib_fmr *fmr; -u64 *dma; };enum rds_ib_fr_state {
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 10/37 IB/core: Change the type of an ib_dma_alloc_coherent() argument
In reply to a message not in the archiveChange the type of the dma_handle argument from u64 * to dma_addr_t *. This patch does not change any functionality.
--- include/rdma/ib_verbs.h | 13 ++++++------- net/rds/ib.h | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-)
include/rdma/ib_verbs.h +6 -7
@@ -3171,19 +3171,18 @@ static inline void ib_dma_sync_single_for_device(struct ib_device *dev,*/ static inline void *ib_dma_alloc_coherent (struct ib_device *dev,size_t size, -u64 *dma_handle, +dma_addr_t *dma_handle,gfp_t flag) { -if (dev->dma_ops) -return dev->dma_ops->alloc_coherent (dev, size, dma_handle, flag); -else { -dma_addr_t handle; +if (dev->dma_ops) { +u64 handle;void *ret; - ret =dma_alloc_coherent (dev->dma_device, size, &handle, flag); + ret = dev->dma_ops->alloc_coherent (dev, size, &handle, flag); *dma_handle = handle;return ret; } +return dma_alloc_coherent (dev->dma_device, size, dma_handle, flag); }/**
@@ -3195,7 +3194,7 @@ static inline void *ib_dma_alloc_coherent(struct ib_device *dev,*/ static inline void ib_dma_free_coherent (struct ib_device *dev,size_t size,void *cpu_addr, -u64 dma_handle) +dma_addr_t dma_handle) {if (dev->dma_ops) dev->dma_ops->free_coherent (dev, size, cpu_addr, dma_handle);
net/rds/ib.h +3 -3
@@ -134,7 +134,7 @@ struct rds_ib_connection {struct rds_ib_work_ring i_send_ring;struct rm_data_op *i_data_op;struct rds_header *i_send_hdrs; -u64 i_send_hdrs_dma; +dma_addr_t i_send_hdrs_dma;struct rds_ib_send_work *i_sends;atomic_t i_signaled_sends;
@@ -144,7 +144,7 @@ struct rds_ib_connection {struct rds_ib_incoming *i_ibinc;u32 i_recv_data_rem;struct rds_header *i_recv_hdrs; -u64 i_recv_hdrs_dma; +dma_addr_t i_recv_hdrs_dma;struct rds_ib_recv_work *i_recvs;u64 i_ack_recv;/* last ACK received */ struct rds_ib_refill_cache i_cache_incs;
@@ -161,7 +161,7 @@ struct rds_ib_connection {struct rds_header *i_ack;struct ib_send_wr i_ack_wr;struct ib_sge i_ack_sge; -u64 i_ack_dma; +dma_addr_t i_ack_dma;unsigned long i_ack_queued;/* Flow control related information
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 11/37 IB/hf1: Remove DMA mapping code
In reply to a message not in the archiveThe hfi1 DMA mapping code has never been built in any upstream kernel. Hence remove it.
--- drivers/infiniband/hw/hfi1/dma.c | 183 --------------------------------------- 1 file changed, 183 deletions(-) delete mode 100644 drivers/infiniband/hw/hfi1/dma.c
drivers/infiniband/hw/hfi1/dma.c deleted +0 -183
@@ -1,183 +0,0 @@ -/* -* Copyright(c) 2015, 2016 Intel Corporation. -* -* This file is provided under a dual BSD/GPLv2 license. When using or -* redistributing this file, you may do so under either license. -* -* GPL LICENSE SUMMARY -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of version 2 of the GNU General Public License as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* BSD LICENSE -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of Intel Corporation nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -#include <linux/types.h> -#include <linux/scatterlist.h> - -#include "verbs.h" - -#define BAD_DMA_ADDRESS ((u64)0) - -/* -* The following functions implement driver specific replacements -* for the ib_dma_*() functions. -* -* These functions return kernel virtual addresses instead of -* device bus addresses since the driver uses the CPU to copy -* data instead of using hardware DMA. -*/ - -static int hfi1_mapping_error (struct ib_device *dev,u64 dma_addr) -{ -return dma_addr ==BAD_DMA_ADDRESS ; -} - -static u64 hfi1_dma_map_single (struct ib_device *dev,void *cpu_addr, -size_t size,enum dma_data_direction direction) -{ -if (WARN_ON (!valid_dma_direction (direction))) -return BAD_DMA_ADDRESS ; - -return (u64 )cpu_addr; -} - -static void hfi1_dma_unmap_single (struct ib_device *dev,u64 addr,size_t size, -enum dma_data_direction direction) -{ -/* This is a stub, nothing to be done here */ -} - -static u64 hfi1_dma_map_page (struct ib_device *dev,struct page *page, -unsigned long offset,size_t size, -enum dma_data_direction direction) -{ -u64 addr; - -if (WARN_ON (!valid_dma_direction (direction))) -return BAD_DMA_ADDRESS ; - -if (offset + size >PAGE_SIZE ) -return BAD_DMA_ADDRESS ; - - addr = (u64 )page_address (page); -if (addr) - addr += offset; - -return addr; -} - -static void hfi1_dma_unmap_page (struct ib_device *dev,u64 addr,size_t size, -enum dma_data_direction direction) -{ -/* This is a stub, nothing to be done here */ -} - -static int hfi1_map_sg (struct ib_device *dev,struct scatterlist *sgl, -int nents,enum dma_data_direction direction) -{ -struct scatterlist *sg; -u64 addr; -int i; -int ret = nents; - -if (WARN_ON (!valid_dma_direction (direction))) -return BAD_DMA_ADDRESS ; - -for_each_sg (sgl, sg, nents, i) { - addr = (u64 )page_address (sg_page (sg)); -if (!addr) { - ret =0 ; -break ; - } - sg->dma_address = addr + sg->offset; -#ifdef CONFIG_NEED_SG_DMA_LENGTH - sg->dma_length = sg->length; -#endif - } -return ret; -} - -static void hfi1_unmap_sg (struct ib_device *dev, -struct scatterlist *sg,int nents, -enum dma_data_direction direction) -{ -/* This is a stub, nothing to be done here */ -} - -static void hfi1_sync_single_for_cpu (struct ib_device *dev,u64 addr, -size_t size,enum dma_data_direction dir) -{ -} - -static void hfi1_sync_single_for_device (struct ib_device *dev,u64 addr, -size_t size, -enum dma_data_direction dir) -{ -} - -static void *hfi1_dma_alloc_coherent (struct ib_device *dev,size_t size, -u64 *dma_handle,gfp_t flag) -{ -struct page *p; -void *addr =NULL ; - - p =alloc_pages (flag,get_order (size)); -if (p) - addr =page_address (p); -if (dma_handle) - *dma_handle = (u64 )addr; -return addr; -} - -static void hfi1_dma_free_coherent (struct ib_device *dev,size_t size, -void *cpu_addr,u64 dma_handle) -{ -free_pages ((unsigned long )cpu_addr,get_order (size)); -} - -struct ib_dma_mapping_ops hfi1_dma_mapping_ops = { - .mapping_error = hfi1_mapping_error, - .map_single = hfi1_dma_map_single, - .unmap_single = hfi1_dma_unmap_single, - .map_page = hfi1_dma_map_page, - .unmap_page = hfi1_dma_unmap_page, - .map_sg = hfi1_map_sg, - .unmap_sg = hfi1_unmap_sg, - .sync_single_for_cpu = hfi1_sync_single_for_cpu, - .sync_single_for_device = hfi1_sync_single_for_device, - .alloc_coherent = hfi1_dma_alloc_coherent, - .free_coherent = hfi1_dma_free_coherent -};
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 12/37 IB/qib: Remove DMA mapping code
In reply to a message not in the archiveThe qib DMA mapping code is no longer built since commit eb636ac0e49e ("IB/qib: Remove dma.c and use rdmavt version of dma functions"). Hence remove it.
--- drivers/infiniband/hw/qib/qib_dma.c | 169 ----------------------------------- drivers/infiniband/hw/qib/qib_keys.c | 5 +- 2 files changed, 1 insertion(+), 173 deletions(-) delete mode 100644 drivers/infiniband/hw/qib/qib_dma.c
drivers/infiniband/hw/qib/qib_dma.c deleted +0 -169
@@ -1,169 +0,0 @@ -/* -* Copyright (c) 2006, 2009, 2010 QLogic, Corporation. All rights reserved. -* -* This software is available to you under a choice of one of two -* licenses. You may choose to be licensed under the terms of the GNU -* General Public License (GPL) Version 2, available from the file -* COPYING in the main directory of this source tree, or the -* OpenIB.org BSD license below: -* -* Redistribution and use in source and binary forms, with or -* without modification, are permitted provided that the following -* conditions are met: -* -* - Redistributions of source code must retain the above -* copyright notice, this list of conditions and the following -* disclaimer. -* -* - Redistributions in binary form must reproduce the above -* copyright notice, this list of conditions and the following -* disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -* SOFTWARE. -*/ -#include <linux/types.h> -#include <linux/scatterlist.h> - -#include "qib_verbs.h" - -#define BAD_DMA_ADDRESS ((u64) 0) - -/* -* The following functions implement driver specific replacements -* for the ib_dma_*() functions. -* -* These functions return kernel virtual addresses instead of -* device bus addresses since the driver uses the CPU to copy -* data instead of using hardware DMA. -*/ - -static int qib_mapping_error (struct ib_device *dev,u64 dma_addr) -{ -return dma_addr ==BAD_DMA_ADDRESS ; -} - -static u64 qib_dma_map_single (struct ib_device *dev,void *cpu_addr, -size_t size,enum dma_data_direction direction) -{ -BUG_ON (!valid_dma_direction (direction)); -return (u64 ) cpu_addr; -} - -static void qib_dma_unmap_single (struct ib_device *dev,u64 addr,size_t size, -enum dma_data_direction direction) -{ -BUG_ON (!valid_dma_direction (direction)); -} - -static u64 qib_dma_map_page (struct ib_device *dev,struct page *page, -unsigned long offset,size_t size, -enum dma_data_direction direction) -{ -u64 addr; - -BUG_ON (!valid_dma_direction (direction)); - -if (offset + size >PAGE_SIZE ) { - addr =BAD_DMA_ADDRESS ; - goto done; - } - - addr = (u64 )page_address (page); -if (addr) - addr += offset; -/* TODO: handle highmem pages */ - -done: -return addr; -} - -static void qib_dma_unmap_page (struct ib_device *dev,u64 addr,size_t size, -enum dma_data_direction direction) -{ -BUG_ON (!valid_dma_direction (direction)); -} - -static int qib_map_sg (struct ib_device *dev,struct scatterlist *sgl, -int nents,enum dma_data_direction direction) -{ -struct scatterlist *sg; -u64 addr; -int i; -int ret = nents; - -BUG_ON (!valid_dma_direction (direction)); - -for_each_sg (sgl, sg, nents, i) { - addr = (u64 )page_address (sg_page (sg)); -/* TODO: handle highmem pages */ -if (!addr) { - ret =0 ; -break ; - } - sg->dma_address = addr + sg->offset; -#ifdef CONFIG_NEED_SG_DMA_LENGTH - sg->dma_length = sg->length; -#endif - } -return ret; -} - -static void qib_unmap_sg (struct ib_device *dev, -struct scatterlist *sg,int nents, -enum dma_data_direction direction) -{ -BUG_ON (!valid_dma_direction (direction)); -} - -static void qib_sync_single_for_cpu (struct ib_device *dev,u64 addr, -size_t size,enum dma_data_direction dir) -{ -} - -static void qib_sync_single_for_device (struct ib_device *dev,u64 addr, -size_t size, -enum dma_data_direction dir) -{ -} - -static void *qib_dma_alloc_coherent (struct ib_device *dev,size_t size, -u64 *dma_handle,gfp_t flag) -{ -struct page *p; -void *addr =NULL ; - - p =alloc_pages (flag,get_order (size)); -if (p) - addr =page_address (p); -if (dma_handle) - *dma_handle = (u64 ) addr; -return addr; -} - -static void qib_dma_free_coherent (struct ib_device *dev,size_t size, -void *cpu_addr,u64 dma_handle) -{ -free_pages ((unsigned long ) cpu_addr,get_order (size)); -} - -struct ib_dma_mapping_ops qib_dma_mapping_ops = { - .mapping_error = qib_mapping_error, - .map_single = qib_dma_map_single, - .unmap_single = qib_dma_unmap_single, - .map_page = qib_dma_map_page, - .unmap_page = qib_dma_unmap_page, - .map_sg = qib_map_sg, - .unmap_sg = qib_unmap_sg, - .sync_single_for_cpu = qib_sync_single_for_cpu, - .sync_single_for_device = qib_sync_single_for_device, - .alloc_coherent = qib_dma_alloc_coherent, - .free_coherent = qib_dma_free_coherent -};
drivers/infiniband/hw/qib/qib_keys.c +1 -4
@@ -158,10 +158,7 @@ int qib_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge,unsigned n, m;size_t off; -/* -* We use RKEY == zero for kernel virtual addresses -* (see qib_get_dma_mr and qib_dma.c). -*/ +/* We use RKEY == zero for kernel virtual addresses */ rcu_read_lock ();if (rkey ==0 ) {struct rvt_pd *pd =ibpd_to_rvtpd (qp->ibqp.pd);
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 13/37 IB/core: Initialize ib_device.dev.parent earlier
In reply to a message not in the archiveMove the ib_device.dev.parent initialization code from ib_device_register_sysfs() to ib_register_device(). Additionally, allow HBA drivers to set ib_device.dev.parent without setting ib_device.dma_device. This is the first step towards removing ib_device.dma_device.
--- drivers/infiniband/core/device.c | 8 ++++++++ drivers/infiniband/core/sysfs.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/infiniband/core/device.c +8 -0
@@ -334,6 +334,14 @@ int ib_register_device(struct ib_device *device,struct ib_client *client;struct ib_udata uhw = {.outlen =0 , .inlen =0 }; +WARN_ON_ONCE (!device->dev.parent && !device->dma_device); +WARN_ON_ONCE (device->dev.parent && device->dma_device + && device->dev.parent != device->dma_device); +if (!device->dev.parent) + device->dev.parent = device->dma_device; +if (!device->dma_device) + device->dma_device = device->dev.parent; +mutex_lock (&device_mutex);if (strchr (device->name,'%' )) {
drivers/infiniband/core/sysfs.c +1 -1
@@ -1258,7 +1258,7 @@ int ib_device_register_sysfs(struct ib_device *device,int ret;int i; - device->dev.parent = device->dma_device; +WARN_ON_ONCE (!device->dev.parent); ret =dev_set_name (class_dev,"%s" , device->name);if (ret)return ret;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 14/37 IB/core: Use dev.parent instead of dma_device
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/core/ucm.c | 2 +- drivers/infiniband/core/user_mad.c | 4 ++-- drivers/infiniband/core/uverbs_main.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/infiniband/core/ucm.c +1 -1
@@ -1290,7 +1290,7 @@ static void ib_ucm_add_one(struct ib_device *device) goto err; ucm_dev->dev.class = &cm_class; - ucm_dev->dev.parent = device->dma_device; + ucm_dev->dev.parent = device->dev.parent; ucm_dev->dev.devt = ucm_dev->cdev.dev; ucm_dev->dev.release = ib_ucm_release_dev;dev_set_name (&ucm_dev->dev,"ucm%d" , ucm_dev->devnum);
drivers/infiniband/core/user_mad.c +2 -2
@@ -1188,7 +1188,7 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,if (cdev_add (&port->cdev, base,1 )) goto err_cdev; - port->dev =device_create (umad_class, device->dma_device, + port->dev =device_create (umad_class, device->dev.parent, port->cdev.dev, port,"umad%d" , port->dev_num);if (IS_ERR (port->dev))
@@ -1207,7 +1207,7 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,if (cdev_add (&port->sm_cdev, base,1 )) goto err_sm_cdev; - port->sm_dev =device_create (umad_class, device->dma_device, + port->sm_dev =device_create (umad_class, device->dev.parent, port->sm_cdev.dev, port,"issm%d" , port->dev_num);if (IS_ERR (port->sm_dev))
drivers/infiniband/core/uverbs_main.c +1 -1
@@ -1174,7 +1174,7 @@ static void ib_uverbs_add_one(struct ib_device *device)if (cdev_add (&uverbs_dev->cdev, base,1 )) goto err_cdev; - uverbs_dev->dev =device_create (uverbs_class, device->dma_device, + uverbs_dev->dev =device_create (uverbs_class, device->dev.parent, uverbs_dev->cdev.dev, uverbs_dev,"uverbs%d" , uverbs_dev->devnum);if (IS_ERR (uverbs_dev->dev))
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 15/37 IB/cxgb3: Set dev.parent instead of dma_device
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/cxgb3/iwch_provider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/cxgb3/iwch_provider.c +1 -1
@@ -1401,7 +1401,7 @@ int iwch_register_device(struct iwch_dev *dev)memcpy (dev->ibdev.node_desc,IWCH_NODE_DESC ,sizeof (IWCH_NODE_DESC )); dev->ibdev.phys_port_cnt = dev->rdev.port_info.nports; dev->ibdev.num_comp_vectors =1 ; - dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev); + dev->ibdev.dev.parent = &dev->rdev.rnic_info.pdev->dev; dev->ibdev.query_device = iwch_query_device; dev->ibdev.query_port = iwch_query_port; dev->ibdev.query_pkey = iwch_query_pkey;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-16-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Steve Wise
Acked-byRE: [PATCH v3 15/37] IB/cxgb3: Set dev.parent instead of dma_device
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 16/37 IB/cxgb4: Set dev.parent instead of dma_device
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/cxgb4/provider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/cxgb4/provider.c +1 -1
@@ -569,7 +569,7 @@ int c4iw_register_device(struct c4iw_dev *dev)memcpy (dev->ibdev.node_desc,C4IW_NODE_DESC ,sizeof (C4IW_NODE_DESC )); dev->ibdev.phys_port_cnt = dev->rdev.lldi.nports; dev->ibdev.num_comp_vectors = dev->rdev.lldi.nciq; - dev->ibdev.dma_device = &(dev->rdev.lldi.pdev->dev); + dev->ibdev.dev.parent = &dev->rdev.lldi.pdev->dev; dev->ibdev.query_device = c4iw_query_device; dev->ibdev.query_port = c4iw_query_port; dev->ibdev.query_pkey = c4iw_query_pkey;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-17-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Steve Wise
Acked-byRE: [PATCH v3 16/37] IB/cxgb4: Set dev.parent instead of dma_device
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 17/37 IB/hfi1: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/hfi1/mad.c | 2 +- drivers/infiniband/hw/hfi1/verbs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/mad.c +1 -1
@@ -4406,7 +4406,7 @@ int hfi1_process_mad(struct ib_device *ibdev, int mad_flags, u8 port,switch (in_mad->base_version) {case OPA_MGMT_BASE_VERSION :if (unlikely (in_mad_size !=sizeof (struct opa_mad ))) { -dev_err (ibdev->dma_device,"invalid in_mad_size\n" ); +dev_err (ibdev->dev.parent,"invalid in_mad_size\n" );return IB_MAD_RESULT_FAILURE ; } return hfi1_process_opa_mad(ibdev, mad_flags, port,
drivers/infiniband/hw/hfi1/verbs.c +1 -1
@@ -1784,7 +1784,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)strlcpy (ibdev->name + lcpysz,"_%d" ,IB_DEVICE_NAME_MAX - lcpysz); ibdev->owner =THIS_MODULE ; ibdev->phys_port_cnt = dd->num_pports; - ibdev->dma_device = &dd->pcidev->dev; + ibdev->dev.parent = &dd->pcidev->dev; ibdev->modify_device = modify_device; ibdev->alloc_hw_stats = alloc_hw_stats; ibdev->get_hw_stats = get_hw_stats;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 18/37 IB/hns: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hns/hns_roce_main.c +1 -1
@@ -437,7 +437,7 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev) ib_dev->owner =THIS_MODULE ; ib_dev->node_type =RDMA_NODE_IB_CA ; - ib_dev->dma_device = dev; + ib_dev->dev.parent = dev; ib_dev->phys_port_cnt = hr_dev->caps.num_ports; ib_dev->local_dma_lkey = hr_dev->caps.reserved_lkey;
drivers/infiniband/hw/hns/hns_roce_qp.c +1 -1
@@ -101,7 +101,7 @@ static void hns_roce_ib_qp_event(struct hns_roce_qp *hr_qp, event.event =IB_EVENT_QP_ACCESS_ERR ;break ;default : -dev_dbg (ibqp->device->dma_device,"roce_ib: Unexpected event type %d on QP %06lx\n" , +dev_dbg (ibqp->device->dev.parent,"roce_ib: Unexpected event type %d on QP %06lx\n" , type, hr_qp->qpn);return ; }
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 19/37 IB/i40iw: Remove a superfluous assignment statement
In reply to a message not in the archiveDue to a previous patch initializing ib_device.dev.parent is sufficient and initializing dma_device is no longer needed.
--- drivers/infiniband/hw/i40iw/i40iw_verbs.c | 1 - 1 file changed, 1 deletion(-)
drivers/infiniband/hw/i40iw/i40iw_verbs.c +0 -1
@@ -2767,7 +2767,6 @@ static struct i40iw_ib_device *i40iw_init_rdma_device(struct i40iw_device *iwdev (1ull <<IB_USER_VERBS_CMD_POST_SEND ); iwibdev->ibdev.phys_port_cnt =1 ; iwibdev->ibdev.num_comp_vectors = iwdev->ceqs_count; - iwibdev->ibdev.dma_device = &pcidev->dev; iwibdev->ibdev.dev.parent = &pcidev->dev; iwibdev->ibdev.query_port = i40iw_query_port; iwibdev->ibdev.modify_port = i40iw_modify_port;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-20-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Shiraz Saleem
Acked-byRe: [PATCH v3 19/37] IB/i40iw: Remove a superfluous assignment statement
Quoted 3 lines · Bart Van Assche
Due to a previous patch initializing ib_device.dev.parent is sufficient and initializing
dma_deviceis no longer needed.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 20/37 IB/mlx4: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/mlx4/main.c | 2 +- drivers/infiniband/hw/mlx4/mlx4_ib.h | 2 +- drivers/infiniband/hw/mlx4/mr.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/infiniband/hw/mlx4/main.c +1 -1
@@ -2625,7 +2625,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ibdev->ib_dev.phys_port_cnt =mlx4_is_bonded (dev) ?1 : ibdev->num_ports; ibdev->ib_dev.num_comp_vectors = dev->caps.num_comp_vectors; - ibdev->ib_dev.dma_device = &dev->persist->pdev->dev; + ibdev->ib_dev.dev.parent = &dev->persist->pdev->dev; ibdev->ib_dev.get_netdev = mlx4_ib_get_netdev; ibdev->ib_dev.add_gid = mlx4_ib_add_gid; ibdev->ib_dev.del_gid = mlx4_ib_del_gid;
drivers/infiniband/hw/mlx4/mlx4_ib.h +1 -1
@@ -55,7 +55,7 @@#define pr_fmt (fmt) "<" MLX4_IB_DRV_NAME "> %s: " fmt, __func__ #define mlx4_ib_warn(ibdev, format, arg...) \ - dev_warn((ibdev)->dma_device, MLX4_IB_DRV_NAME ": " format, ## arg) + dev_warn((ibdev)->dev.parent, MLX4_IB_DRV_NAME ": " format, ## arg)enum {MLX4_IB_SQ_MIN_WQE_SHIFT =6 ,
drivers/infiniband/hw/mlx4/mr.c +3 -3
@@ -292,10 +292,10 @@ mlx4_alloc_priv_pages(struct ib_device *device,if (!mr->pages)return -ENOMEM ; - mr->page_map =dma_map_single (device->dma_device, mr->pages, + mr->page_map =dma_map_single (device->dev.parent, mr->pages, mr->page_map_size,DMA_TO_DEVICE ); -if (dma_mapping_error (device->dma_device, mr->page_map)) { +if (dma_mapping_error (device->dev.parent, mr->page_map)) { ret = -ENOMEM ; goto err; }
@@ -313,7 +313,7 @@ mlx4_free_priv_pages(struct mlx4_ib_mr *mr)if (mr->pages) {struct ib_device *device = mr->ibmr.device; -dma_unmap_single (device->dma_device, mr->page_map, +dma_unmap_single (device->dev.parent, mr->page_map, mr->page_map_size,DMA_TO_DEVICE );free_page ((unsigned long )mr->pages); mr->pages =NULL ;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 21/37 IB/mlx5: Switch from dma_device to dev.parent
In reply to a message not in the archive--- drivers/infiniband/hw/mlx5/main.c | 2 +- drivers/infiniband/hw/mlx5/mr.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/infiniband/hw/mlx5/main.c +1 -1
@@ -3075,7 +3075,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) dev->ib_dev.phys_port_cnt = dev->num_ports; dev->ib_dev.num_comp_vectors = dev->mdev->priv.eq_table.num_comp_vectors; - dev->ib_dev.dma_device = &mdev->pdev->dev; + dev->ib_dev.dev.parent = &mdev->pdev->dev; dev->ib_dev.uverbs_abi_ver =MLX5_IB_UVERBS_ABI_VERSION ; dev->ib_dev.uverbs_cmd_mask =
drivers/infiniband/hw/mlx5/mr.c +7 -7
@@ -767,7 +767,7 @@ static int dma_map_mr_pas(struct mlx5_ib_dev *dev, struct ib_umem *umem, __be64 **mr_pas, dma_addr_t *dma) {__be64 *pas; -struct device *ddev = dev->ib_dev.dma_device; +struct device *ddev = dev->ib_dev.dev.parent;/* * UMR copies MTTs in units of MLX5_UMR_MTT_ALIGNMENT bytes.
@@ -896,7 +896,7 @@ static struct mlx5_ib_mr *reg_umr(struct ib_pd *pd, struct ib_umem *umem, int page_shift, int order, int access_flags) { struct mlx5_ib_dev *dev = to_mdev(pd->device); -struct device *ddev = dev->ib_dev.dma_device; +struct device *ddev = dev->ib_dev.dev.parent;struct umr_common *umrc = &dev->umrc;struct mlx5_ib_umr_context umr_context;struct mlx5_umr_wr umrwr = {};
@@ -974,7 +974,7 @@ int mlx5_ib_update_mtt(struct mlx5_ib_mr *mr, u64 start_page_index, int npages, int zap) {struct mlx5_ib_dev *dev = mr->dev; -struct device *ddev = dev->ib_dev.dma_device; +struct device *ddev = dev->ib_dev.dev.parent;struct umr_common *umrc = &dev->umrc;struct mlx5_ib_umr_context umr_context;struct ib_umem *umem = mr->umem;
@@ -1288,7 +1288,7 @@ static int rereg_umr(struct ib_pd *pd, struct mlx5_ib_mr *mr, u64 virt_addr, int access_flags, int flags) {struct mlx5_ib_dev *dev =to_mdev (pd->device); -struct device *ddev = dev->ib_dev.dma_device; +struct device *ddev = dev->ib_dev.dev.parent;struct mlx5_ib_umr_context umr_context;struct ib_send_wr *bad;struct mlx5_umr_wr umrwr = {};
@@ -1461,9 +1461,9 @@ mlx5_alloc_priv_descs(struct ib_device *device, mr->descs =PTR_ALIGN (mr->descs_alloc,MLX5_UMR_ALIGN ); - mr->desc_map =dma_map_single (device->dma_device, mr->descs, + mr->desc_map =dma_map_single (device->dev.parent, mr->descs, size,DMA_TO_DEVICE ); -if (dma_mapping_error (device->dma_device, mr->desc_map)) { +if (dma_mapping_error (device->dev.parent, mr->desc_map)) { ret = -ENOMEM ; goto err; }
@@ -1482,7 +1482,7 @@ mlx5_free_priv_descs(struct mlx5_ib_mr *mr)struct ib_device *device = mr->ibmr.device;int size = mr->max_descs * mr->desc_size; -dma_unmap_single (device->dma_device, mr->desc_map, +dma_unmap_single (device->dev.parent, mr->desc_map, size,DMA_TO_DEVICE );kfree (mr->descs_alloc); mr->descs =NULL ;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-22-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Leon Romanovsky
Acked-byRe: [PATCH v3 21/37] IB/mlx5: Switch from dma_device to dev.parent
Quoted 8 lines · Bart Van Assche
Signed-off-by Bart Van Assche <[email protected]>Cc Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/[email protected]>Cc Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>--- drivers/infiniband/hw/mlx5/main.c | 2 +- drivers/infiniband/hw/mlx5/mr.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-)
Thanks,
PATCH v3 22/37 IB/mthca: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/mthca/mthca_provider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mthca/mthca_provider.c +1 -1
@@ -1223,7 +1223,7 @@ int mthca_register_device(struct mthca_dev *dev) dev->ib_dev.node_type =RDMA_NODE_IB_CA ; dev->ib_dev.phys_port_cnt = dev->limits.num_ports; dev->ib_dev.num_comp_vectors =1 ; - dev->ib_dev.dma_device = &dev->pdev->dev; + dev->ib_dev.dev.parent = &dev->pdev->dev; dev->ib_dev.query_device = mthca_query_device; dev->ib_dev.query_port = mthca_query_port; dev->ib_dev.modify_device = mthca_modify_device;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 23/37 IB/nes: Remove a superfluous assignment statement
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/nes/nes_verbs.c | 1 - 1 file changed, 1 deletion(-)
drivers/infiniband/hw/nes/nes_verbs.c +0 -1
@@ -3740,7 +3740,6 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev) nesibdev->ibdev.phys_port_cnt =1 ; nesibdev->ibdev.num_comp_vectors =1 ; - nesibdev->ibdev.dma_device = &nesdev->pcidev->dev; nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev; nesibdev->ibdev.query_device = nes_query_device; nesibdev->ibdev.query_port = nes_query_port;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 24/37 IB/ocrdma: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/ocrdma/ocrdma_main.c +1 -1
@@ -198,7 +198,7 @@ static int ocrdma_register_device(struct ocrdma_dev *dev) dev->ibdev.alloc_ucontext = ocrdma_alloc_ucontext; dev->ibdev.dealloc_ucontext = ocrdma_dealloc_ucontext; dev->ibdev.mmap = ocrdma_mmap; - dev->ibdev.dma_device = &dev->nic_info.pdev->dev; + dev->ibdev.dev.parent = &dev->nic_info.pdev->dev; dev->ibdev.process_mad = ocrdma_process_mad; dev->ibdev.get_port_immutable = ocrdma_port_immutable;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 25/37 IB/qedr: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/qedr/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/qedr/main.c +1 -1
@@ -170,7 +170,7 @@ static int qedr_register_device(struct qedr_dev *dev) dev->ibdev.get_port_immutable = qedr_port_immutable; dev->ibdev.get_netdev = qedr_get_netdev; - dev->ibdev.dma_device = &dev->pdev->dev; + dev->ibdev.dev.parent = &dev->pdev->dev; dev->ibdev.get_link_layer = qedr_link_layer; dev->ibdev.get_dev_fw_str = qedr_get_dev_fw_str;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 26/37 IB/qib: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/qib/qib_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/qib/qib_verbs.c +1 -1
@@ -1632,7 +1632,7 @@ int qib_register_ib_device(struct qib_devdata *dd) ibdev->owner =THIS_MODULE ; ibdev->node_guid = ppd->guid; ibdev->phys_port_cnt = dd->num_pports; - ibdev->dma_device = &dd->pcidev->dev; + ibdev->dev.parent = &dd->pcidev->dev; ibdev->modify_device = qib_modify_device; ibdev->process_mad = qib_process_mad;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 27/37 IB/usnic: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/usnic/usnic_ib_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/usnic/usnic_ib_main.c +1 -1
@@ -380,7 +380,7 @@ static void *usnic_ib_device_add(struct pci_dev *dev) us_ibdev->ib_dev.node_type =RDMA_NODE_USNIC_UDP ; us_ibdev->ib_dev.phys_port_cnt =USNIC_IB_PORT_CNT ; us_ibdev->ib_dev.num_comp_vectors =USNIC_IB_NUM_COMP_VECTORS ; - us_ibdev->ib_dev.dma_device = &dev->dev; + us_ibdev->ib_dev.dev.parent = &dev->dev; us_ibdev->ib_dev.uverbs_abi_ver =USNIC_UVERBS_ABI_VERSION ;strlcpy (us_ibdev->ib_dev.name,"usnic_%d" ,IB_DEVICE_NAME_MAX );
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 28/37 IB/vmw_pvrdma: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +1 -1
@@ -172,7 +172,7 @@ static int pvrdma_register_device(struct pvrdma_dev *dev) dev->flags =0 ; dev->ib_dev.owner =THIS_MODULE ; dev->ib_dev.num_comp_vectors =1 ; - dev->ib_dev.dma_device = &dev->pdev->dev; + dev->ib_dev.dev.parent = &dev->pdev->dev; dev->ib_dev.uverbs_abi_ver =PVRDMA_UVERBS_ABI_VERSION ; dev->ib_dev.uverbs_cmd_mask = (1ull << IB_USER_VERBS_CMD_GET_CONTEXT) |
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-29-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Adit Ranadive
Acked-byRe: [PATCH v3 28/37] IB/vmw_pvrdma: Switch from dma_device to dev.parent
Quoted 14 lines · Bart Van Assche
Prepare for removal of ib_device.dma_device.
Signed-off-by Bart Van Assche <[email protected]>Cc Adit Ranadive <[email protected]>Cc VMware PV-Drivers <[email protected]>--- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +0
-0
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c static int pvrdma_register_device(struct pvrdma_dev *dev) · line 178
Quoted 8 lines
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +1
-1@@ -172,7 +172,7 @@ static int pvrdma_register_device(struct pvrdma_dev *dev) dev->flags =0 ; dev->ib_dev.owner =THIS_MODULE ; dev->ib_dev.num_comp_vectors =1 ; - dev->ib_dev.dma_device = &dev->pdev->dev; + dev->ib_dev.dev.parent = &dev->pdev->dev; dev->ib_dev.uverbs_abi_ver =PVRDMA_UVERBS_ABI_VERSION ; dev->ib_dev.uverbs_cmd_mask = (1ull << IB_USER_VERBS_CMD_GET_CONTEXT) |
Thanks,
Adit
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 29/37 IB/rxe: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/sw/rxe/rxe_verbs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/sw/rxe/rxe_verbs.c +3 -3
@@ -168,7 +168,7 @@ static int rxe_query_pkey(struct ib_device *device,struct rxe_port *port;if (unlikely (port_num !=1 )) { -dev_warn (device->dma_device,"invalid port_num = %d\n" , +dev_warn (device->dev.parent,"invalid port_num = %d\n" , port_num); goto err1; }
@@ -176,7 +176,7 @@ static int rxe_query_pkey(struct ib_device *device, port = &rxe->port;if (unlikely (index >= port->attr.pkey_tbl_len)) { -dev_warn (device->dma_device,"invalid index = %d\n" , +dev_warn (device->dev.parent,"invalid index = %d\n" , index); goto err1; }
@@ -1234,7 +1234,7 @@ int rxe_register_device(struct rxe_dev *rxe) dev->node_type =RDMA_NODE_IB_CA ; dev->phys_port_cnt =1 ; dev->num_comp_vectors =RXE_NUM_COMP_VECTORS ; - dev->dma_device = rxe->ifc_ops->dma_device (rxe); + dev->dev.parent = rxe->ifc_ops->dma_device (rxe); dev->local_dma_lkey =0 ; dev->node_guid = rxe->ifc_ops->node_guid (rxe); dev->dma_ops = &rxe_dma_mapping_ops;
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-30-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Boyer, Andrew
Reviewed-byRe: [PATCH v3 29/37] IB/rxe: Switch from dma_device to dev.parent
Quoted 9 lines · On 1/20/17, 4:04 PM, "[email protected]…
Prepare for removal of ib_device.dma_device.
Signed-off-by Bart Van Assche <[email protected]>Cc Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/[email protected]>---
drivers/infiniband/sw/rxe/rxe_verbs.c| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/sw/rxe/rxe_verbs.c int rxe_register_device(struct rxe_dev *rxe) · line 1240
Quoted 8 lines
drivers/infiniband/sw/rxe/rxe_verbs.c +1
-1@@ -1234,7 +1234,7 @@ int rxe_register_device(struct rxe_dev *rxe) dev->node_type =RDMA_NODE_IB_CA ; dev->phys_port_cnt =1 ; dev->num_comp_vectors =RXE_NUM_COMP_VECTORS ; - dev->dma_device = rxe->ifc_ops->dma_device (rxe); + dev->dev.parent = rxe->ifc_ops->dma_device (rxe); dev->local_dma_lkey =0 ; dev->node_guid = rxe->ifc_ops->node_guid (rxe); dev->dma_ops = &rxe_dma_mapping_ops;
ifc_ops was recently removed, so this will be a minor merge conflict.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): D4AFCE43.A031%[email protected]
Re: [PATCH v3 29/37] IB/rxe: Switch from dma_device to dev.parent
Quoted 12 lines · Andrew
Quoted 8 lines · On 1/20/17, 4:04 PM, "[email protected]…
Prepare for removal of ib_device.dma_device.
Signed-off-by Bart Van Assche <[email protected]>Cc Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/[email protected]>---
drivers/infiniband/sw/rxe/rxe_verbs.c| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 11 lines
drivers/infiniband/sw/rxe/rxe_verbs.c int rxe_register_device(struct rxe_dev *rxe) · line 1240
Quoted 9 lines
drivers/infiniband/sw/rxe/rxe_verbs.c +1
-1@@ -1234,7 +1234,7 @@ int rxe_register_device(struct rxe_dev *rxe) dev->node_type =RDMA_NODE_IB_CA ; dev->phys_port_cnt =1 ; dev->num_comp_vectors =RXE_NUM_COMP_VECTORS ; - dev->dma_device = rxe->ifc_ops->dma_device (rxe); + dev->dev.parent = rxe->ifc_ops->dma_device (rxe); dev->local_dma_lkey =0 ; dev->node_guid = rxe->ifc_ops->node_guid (rxe); dev->dma_ops = &rxe_dma_mapping_ops;
ifc_opswas recently removed, so this will be a minor merge conflict.
Hello Andrew,
Thanks for the review.
Doug, do you expect me to resolve this merge conflict by rebasing this patch series (something Linus doesn't like) once Linus has pulled your v4.11 pull request or are you going to explain to Linus how he should resolve this merge conflict himself?
Thanks,
Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1485555269.13218.10.camel-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Re: [PATCH v3 29/37] IB/rxe: Switch from dma_device to dev.parent
Quoted 32 lines · Bart Van Assche
Quoted 15 lines · Andrew
On 1/20/17, 4:04 PM, "[email protected] on behalf of Bart
Van Assche" <[email protected] on behalf ofQuoted 9 lines · [email protected]> wrote:
Prepare for removal of ib_device.dma_device.
Signed-off-by Bart Van Assche <[email protected]>Cc Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/[email protected]>---
drivers/infiniband/sw/rxe/rxe_verbs.c| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)Quoted 13 lines
Quoted 10 lines
drivers/infiniband/sw/rxe/rxe_verbs.c +1
-1@@ -1234,7 +1234,7 @@ int rxe_register_device(struct rxe_dev *rxe) dev->node_type =RDMA_NODE_IB_CA ; dev->phys_port_cnt =1 ; dev->num_comp_vectors =RXE_NUM_COMP_VECTORS ; - dev->dma_device = rxe->ifc_ops->dma_device (rxe); + dev->dev.parent = rxe->ifc_ops->dma_device (rxe); dev->local_dma_lkey =0 ; dev->node_guid = rxe->ifc_ops->node_guid (rxe);dev->dma_ops = &rxe_dma_mapping_ops;
ifc_opswas recently removed, so this will be a minor merge conflict.Hello Andrew,
Quoted 8 lines
Thanks for the review.
Doug, do you expect me to resolve this merge conflict by rebasing this
patch series (something Linus doesn't like) once Linus has pulled your
v4.11 pull request or are you going to explain to Linus how he should resolve this merge conflict himself?
I'm going to do a local merge fixup run before I send it and will notify Linus of any fixes needed.
Signature · 4 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
PATCH v3 30/37 IB/IPoIB: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_ethtool.c +1 -1
@@ -65,7 +65,7 @@ static void ipoib_get_drvinfo(struct net_device *netdev,ib_get_device_fw_str (priv->ca, drvinfo->fw_version,sizeof (drvinfo->fw_version)); -strlcpy (drvinfo->bus_info,dev_name (priv->ca->dma_device), +strlcpy (drvinfo->bus_info,dev_name (priv->ca->dev.parent),sizeof (drvinfo->bus_info)); strlcpy(drvinfo->version, ipoib_driver_version,
drivers/infiniband/ulp/ipoib/ipoib_main.c +1 -1
@@ -2011,7 +2011,7 @@ static struct net_device *ipoib_add_port(const char *format,if (!priv) goto alloc_mem_failed; -SET_NETDEV_DEV (priv->dev, hca->dma_device); +SET_NETDEV_DEV (priv->dev, hca->dev.parent); priv->dev->dev_id = port -1 ; result =ib_query_port (hca, port, &attr);
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 31/37 IB/iser: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/ulp/iser/iscsi_iser.c +1 -1
@@ -659,7 +659,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep, ib_conn->device->ib_device->attrs.max_fast_reg_page_list_len);if (iscsi_host_add (shost, - ib_conn->device->ib_device->dma_device)) { + ib_conn->device->ib_device->dev.parent)) {mutex_unlock (&iser_conn->state_mutex); goto free_host; }
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 32/37 IB/srp: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/infiniband/ulp/srp/ib_srp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +2 -2
@@ -2904,7 +2904,7 @@ static int srp_add_target(struct srp_host *host, struct srp_target_port *target)sprintf (target->target_name,"SRP.T10:%016llX" ,be64_to_cpu (target->id_ext)); -if (scsi_add_host (target->scsi_host, host->srp_dev->dev->dma_device)) +if (scsi_add_host (target->scsi_host, host->srp_dev->dev->dev.parent))return -ENODEV ;memcpy (ids.port_id, &target->id_ext,8 );
@@ -3515,7 +3515,7 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port) host->port = port; host->dev.class = &srp_class; - host->dev.parent = device->dev->dma_device; + host->dev.parent = device->dev->dev.parent;dev_set_name (&host->dev,"srp-%s-%d" , device->dev->name, port);if (device_register (&host->dev))
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 33/37 IB/srpt: Modify a debug statement
In reply to a message not in the archiveSince a later patch will remove ib_device.dma_device and since knowing the value of that pointer is not too important, remove dma_device from the debug output.
--- drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/ulp/srpt/ib_srpt.c +1 -2
@@ -2464,8 +2464,7 @@ static void srpt_add_one(struct ib_device *device)struct ib_srq_init_attr srq_attr;int i; -pr_debug ("device = %p, device->dma_ops = %p\n" , device, - device->dma_device->dma_ops); +pr_debug ("device = %p\n" , device); sdev =kzalloc (sizeof (*sdev),GFP_KERNEL );if (!sdev)
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 34/37 RDS: net: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- net/rds/ib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/rds/ib.h +1 -1
@@ -223,7 +223,7 @@ struct rds_ib_device {struct work_struct free_work; }; -#define ibdev_to_node (ibdev) dev_to_node(ibdev->dma_device) +#define ibdev_to_node (ibdev) dev_to_node((ibdev)->dev.parent)#define rdsibdev_to_node (rdsibdev) ibdev_to_node(rdsibdev->dev)/* bits for i_ack_flags */
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-35-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Santosh Shilimkar
Acked-byRe: [PATCH v3 34/37] RDS: net: Switch from dma_device to dev.parent
Quoted 3 lines · Bart Van Assche
Prepare for removal of ib_device.dma_device.
Signed-off-by Bart Van Assche <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 35/37 nvme-rdma: Switch from dma_device to dev.parent
In reply to a message not in the archivePrepare for removal of ib_device.dma_device.
--- drivers/nvme/host/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/rdma.c +1 -1
@@ -1265,7 +1265,7 @@ static int nvme_rdma_addr_resolved(struct nvme_rdma_queue *queue) dev =nvme_rdma_find_get_device (queue->cm_id);if (!dev) { -dev_err (queue->cm_id->device->dma_device, +dev_err (queue->cm_id->device->dev.parent,"no client data found!\n" );return -ECONNREFUSED ; }
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-36-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Sagi Grimberg
Acked-byRe: [PATCH v3 35/37] nvme-rdma: Switch from dma_device to dev.parent
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 36/37 IB/core: Remove ib_device.dma_device
In reply to a message not in the archiveAdd code in ib_register_device() for copying the DMA masks. Use &ib_device.dev in DMA mapping operations instead of dma_device. Remove ib_device.dma_device because due to this and previous patches it is no longer used.
--- drivers/infiniband/core/device.c | 17 +++++++++-------- include/rdma/ib_verbs.h | 31 +++++++++++++------------------ 2 files changed, 22 insertions(+), 26 deletions(-)
drivers/infiniband/core/device.c +9 -8
@@ -333,14 +333,15 @@ int ib_register_device(struct ib_device *device,int ret;struct ib_client *client;struct ib_udata uhw = {.outlen =0 , .inlen =0 }; - -WARN_ON_ONCE (!device->dev.parent && !device->dma_device); -WARN_ON_ONCE (device->dev.parent && device->dma_device - && device->dev.parent != device->dma_device); -if (!device->dev.parent) - device->dev.parent = device->dma_device; -if (!device->dma_device) - device->dma_device = device->dev.parent; +struct device *parent = device->dev.parent; + +WARN_ON_ONCE (!parent); +if (!device->dev.dma_ops) + device->dev.dma_ops = parent->dma_ops; +if (!device->dev.dma_mask) + device->dev.dma_mask = parent->dma_mask; +if (!device->dev.coherent_dma_mask) + device->dev.coherent_dma_mask = parent->coherent_dma_mask;mutex_lock (&device_mutex);
include/rdma/ib_verbs.h +13 -18
@@ -1840,8 +1840,6 @@ struct ib_port_immutable { };struct ib_device { -struct device *dma_device; -char name[IB_DEVICE_NAME_MAX ];struct list_head event_handler_list;
@@ -2968,7 +2966,7 @@ static inline int ib_dma_mapping_error(struct ib_device *dev, u64 dma_addr) {if (dev->dma_ops)return dev->dma_ops->mapping_error (dev, dma_addr); -return dma_mapping_error (dev->dma_device, dma_addr); +return dma_mapping_error (&dev->dev, dma_addr); }/**
@@ -2984,7 +2982,7 @@ static inline u64 ib_dma_map_single(struct ib_device *dev, {if (dev->dma_ops)return dev->dma_ops->map_single (dev, cpu_addr, size, direction); -return dma_map_single (dev->dma_device, cpu_addr, size, direction); +return dma_map_single (&dev->dev, cpu_addr, size, direction); }/**
@@ -3001,7 +2999,7 @@ static inline void ib_dma_unmap_single(struct ib_device *dev,if (dev->dma_ops) dev->dma_ops->unmap_single (dev, addr, size, direction);else -dma_unmap_single (dev->dma_device, addr, size, direction); +dma_unmap_single (&dev->dev, addr, size, direction); }/**
@@ -3020,7 +3018,7 @@ static inline u64 ib_dma_map_page(struct ib_device *dev, {if (dev->dma_ops)return dev->dma_ops->map_page (dev, page, offset, size, direction); -return dma_map_page (dev->dma_device, page, offset, size, direction); +return dma_map_page (&dev->dev, page, offset, size, direction); }/**
@@ -3037,7 +3035,7 @@ static inline void ib_dma_unmap_page(struct ib_device *dev,if (dev->dma_ops) dev->dma_ops->unmap_page (dev, addr, size, direction);else -dma_unmap_page (dev->dma_device, addr, size, direction); +dma_unmap_page (&dev->dev, addr, size, direction); }/**
@@ -3053,7 +3051,7 @@ static inline int ib_dma_map_sg(struct ib_device *dev, {if (dev->dma_ops)return dev->dma_ops->map_sg (dev, sg, nents, direction); -return dma_map_sg (dev->dma_device, sg, nents, direction); +return dma_map_sg (&dev->dev, sg, nents, direction); }/**
@@ -3070,7 +3068,7 @@ static inline void ib_dma_unmap_sg(struct ib_device *dev,if (dev->dma_ops) dev->dma_ops->unmap_sg (dev, sg, nents, direction);else -dma_unmap_sg (dev->dma_device, sg, nents, direction); +dma_unmap_sg (&dev->dev, sg, nents, direction); } static inline int ib_dma_map_sg_attrs(struct ib_device *dev,
@@ -3081,9 +3079,7 @@ static inline int ib_dma_map_sg_attrs(struct ib_device *dev,if (dev->dma_ops)return dev->dma_ops->map_sg_attrs (dev, sg, nents, direction, dma_attrs); -else -return dma_map_sg_attrs (dev->dma_device, sg, nents, direction, - dma_attrs); +return dma_map_sg_attrs (&dev->dev, sg, nents, direction, dma_attrs); } static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev,
@@ -3095,8 +3091,7 @@ static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev,return dev->dma_ops->unmap_sg_attrs (dev, sg, nents, direction, dma_attrs); else - dma_unmap_sg_attrs(dev->dma_device, sg, nents, direction, -dma_attrs ); + dma_unmap_sg_attrs(&dev->dev, sg, nents, direction, dma_attrs); }/** * ib_sg_dma_address - Return the DMA address from a scatter/gather entry
@@ -3141,7 +3136,7 @@ static inline void ib_dma_sync_single_for_cpu(struct ib_device *dev,if (dev->dma_ops) dev->dma_ops->sync_single_for_cpu (dev, addr, size, dir);else -dma_sync_single_for_cpu (dev->dma_device, addr, size, dir); +dma_sync_single_for_cpu (&dev->dev, addr, size, dir); }/**
@@ -3159,7 +3154,7 @@ static inline void ib_dma_sync_single_for_device(struct ib_device *dev,if (dev->dma_ops) dev->dma_ops->sync_single_for_device (dev, addr, size, dir);else -dma_sync_single_for_device (dev->dma_device, addr, size, dir); +dma_sync_single_for_device (&dev->dev, addr, size, dir); }/**
@@ -3182,7 +3177,7 @@ static inline void *ib_dma_alloc_coherent(struct ib_device *dev, *dma_handle = handle;return ret; } -return dma_alloc_coherent (dev->dma_device, size, dma_handle, flag); +return dma_alloc_coherent (&dev->dev, size, dma_handle, flag); }/**
@@ -3199,7 +3194,7 @@ static inline void ib_dma_free_coherent(struct ib_device *dev,if (dev->dma_ops) dev->dma_ops->free_coherent (dev, size, cpu_addr, dma_handle);else -dma_free_coherent (dev->dma_device, size, cpu_addr, dma_handle); +dma_free_coherent (&dev->dev, size, cpu_addr, dma_handle); }/**
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 37/37 IB/rxe, IB/rdmavt: Use dma_virt_ops instead of duplicating it
In reply to a message not in the archiveMake the rxe and rdmavt drivers use dma_virt_ops. Update the comments that refer to the source files removed by this patch. Remove struct ib_dma_mapping_ops. Remove ib_device.dma_ops.
--- drivers/infiniband/sw/rdmavt/Kconfig | 1 + drivers/infiniband/sw/rdmavt/Makefile | 2 +- drivers/infiniband/sw/rdmavt/dma.c | 198 ---------------------------------- drivers/infiniband/sw/rdmavt/dma.h | 53 --------- drivers/infiniband/sw/rdmavt/mr.c | 8 +- drivers/infiniband/sw/rdmavt/vt.c | 4 +- drivers/infiniband/sw/rdmavt/vt.h | 1 - drivers/infiniband/sw/rxe/Kconfig | 1 + drivers/infiniband/sw/rxe/Makefile | 1 - drivers/infiniband/sw/rxe/rxe_dma.c | 183 ------------------------------- drivers/infiniband/sw/rxe/rxe_loc.h | 2 - drivers/infiniband/sw/rxe/rxe_verbs.c | 3 +- include/rdma/ib_verbs.h | 103 ++---------------- 13 files changed, 18 insertions(+), 542 deletions(-) delete mode 100644 drivers/infiniband/sw/rdmavt/dma.c delete mode 100644 drivers/infiniband/sw/rdmavt/dma.h delete mode 100644 drivers/infiniband/sw/rxe/rxe_dma.c
drivers/infiniband/sw/rdmavt/Kconfig +1 -0
@@ -1,5 +1,6 @@ config INFINIBAND_RDMAVT tristate "RDMA verbs transport library" depends on 64BIT + select DMA_VIRT_OPS ---help--- This is a common software verbs provider for RDMA networks.
drivers/infiniband/sw/rdmavt/Makefile +1 -1
@@ -7,7 +7,7 @@ # obj-$(CONFIG_INFINIBAND_RDMAVT) += rdmavt.o -rdmavt-y := vt.o ah.o cq.o dma.o mad.o mcast.o mmap.o mr.o pd.o qp.o srq.o \ +rdmavt-y := vt.o ah.o cq.o mad.o mcast.o mmap.o mr.o pd.o qp.o srq.o \ trace.o CFLAGS_trace.o = -I$(src)
drivers/infiniband/sw/rdmavt/dma.c deleted +0 -198
198 lines not on this page · raw message
drivers/infiniband/sw/rdmavt/dma.h deleted +0 -53
53 lines not on this page · raw message
drivers/infiniband/sw/rdmavt/mr.c +4 -4
@@ -305,8 +305,8 @@ static void __rvt_free_mr(struct rvt_mr *mr)* @acc: access flags * * Return: the memory region on success, otherwise returns an errno. -* Note that all DMA addresses should be created via the -* struct ib_dma_mapping_ops functions (see dma.c). +* Note that all DMA addresses should be created via the functions in +* struct dma_virt_ops. */ struct ib_mr *rvt_get_dma_mr (struct ib_pd *pd,int acc) {
@@ -782,7 +782,7 @@ int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,/* * We use LKEY == zero for kernel virtual addresses -* (see rvt_get_dma_mr and dma.c). +* (see rvt_get_dma_mr() and dma_virt_ops). */ rcu_read_lock ();if (sge->lkey ==0 ) {
@@ -880,7 +880,7 @@ int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge,/* * We use RKEY == zero for kernel virtual addresses -* (see rvt_get_dma_mr and dma.c). +* (see rvt_get_dma_mr() and dma_virt_ops). */ rcu_read_lock ();if (rkey ==0 ) {
drivers/infiniband/sw/rdmavt/vt.c +2 -2
@@ -47,6 +47,7 @@#include <linux/module.h> #include <linux/kernel.h> +#include <linux/dma-mapping.h> #include "vt.h" #include "trace.h"
@@ -777,8 +778,7 @@ int rvt_register_device(struct rvt_dev_info *rdi) }/* DMA Operations */ - rdi->ibdev.dma_ops = - rdi->ibdev.dma_ops ? : &rvt_default_dma_mapping_ops; + rdi->ibdev.dev.dma_ops = rdi->ibdev.dev.dma_ops ? : &dma_virt_ops;/* Protection Domain */ spin_lock_init (&rdi->n_pds_lock);
drivers/infiniband/sw/rdmavt/vt.h +0 -1
@@ -50,7 +50,6 @@#include <rdma/rdma_vt.h> #include <linux/pci.h> -#include "dma.h" #include "pd.h" #include "qp.h" #include "ah.h"
drivers/infiniband/sw/rxe/Kconfig +1 -0
@@ -2,6 +2,7 @@ config RDMA_RXE tristate "Software RDMA over Ethernet (RoCE) driver" depends on INET && PCI && INFINIBAND depends on NET_UDP_TUNNEL + select DMA_VIRT_OPS ---help--- This driver implements the InfiniBand RDMA transport over the Linux network stack. It enables a system with a
drivers/infiniband/sw/rxe/Makefile +0 -1
@@ -14,7 +14,6 @@ rdma_rxe-y := \ rxe_qp.o \ rxe_cq.o \ rxe_mr.o \ - rxe_dma.o \ rxe_opcode.o \ rxe_mmap.o \ rxe_icrc.o \
drivers/infiniband/sw/rxe/rxe_dma.c deleted +0 -183
183 lines not on this page · raw message
drivers/infiniband/sw/rxe/rxe_loc.h +0 -2
@@ -221,8 +221,6 @@ int rxe_srq_from_attr(struct rxe_dev *rxe, struct rxe_srq *srq, struct ib_srq_attr *attr, enum ib_srq_attr_mask mask, struct ib_udata *udata); -extern struct ib_dma_mapping_ops rxe_dma_mapping_ops; -void rxe_release (struct kref *kref);int rxe_completer (void *arg);
drivers/infiniband/sw/rxe/rxe_verbs.c +2 -1
@@ -31,6 +31,7 @@* SOFTWARE. */ +#include <linux/dma-mapping.h> #include "rxe.h" #include "rxe_loc.h" #include "rxe_queue.h"
@@ -1237,7 +1238,7 @@ int rxe_register_device(struct rxe_dev *rxe) dev->dev.parent = rxe->ifc_ops->dma_device (rxe); dev->local_dma_lkey =0 ; dev->node_guid = rxe->ifc_ops->node_guid (rxe); - dev->dma_ops = &rxe_dma_mapping_ops; + dev->dev.dma_ops = &dma_virt_ops; dev->uverbs_abi_ver =RXE_UVERBS_ABI_VERSION ; dev->uverbs_cmd_mask =BIT_ULL (IB_USER_VERBS_CMD_GET_CONTEXT )
include/rdma/ib_verbs.h +7 -96
193 lines not on this page · raw message
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170120210437.26389-38-bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Leon Romanovsky
Reviewed-byRe: [PATCH v3 37/37] IB/rxe, IB/rdmavt: Use dma_virt_ops instead of duplicating it
Quoted 34 lines · Bart Van Assche
Make the rxe and rdmavt drivers use
dma_virt_ops. Update the comments that refer to the source files removed by this patch. Remove structib_dma_mapping_ops. Remove ib_device.dma_ops.Signed-off-by Bart Van Assche <[email protected]>Cc Andrew Boyer <[email protected]>Cc Dennis Dalessandro <[email protected]>Cc Jonathan Toppins <[email protected]>Cc Alex Estrin <[email protected]>Cc Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>--- drivers/infiniband/sw/rdmavt/Kconfig | 1 + drivers/infiniband/sw/rdmavt/Makefile | 2 +- drivers/infiniband/sw/rdmavt/dma.c | 198 ---------------------------------- drivers/infiniband/sw/rdmavt/dma.h | 53 --------- drivers/infiniband/sw/rdmavt/mr.c | 8 +- drivers/infiniband/sw/rdmavt/vt.c | 4 +- drivers/infiniband/sw/rdmavt/vt.h | 1 - drivers/infiniband/sw/rxe/Kconfig | 1 + drivers/infiniband/sw/rxe/Makefile | 1 - drivers/infiniband/sw/rxe/rxe_dma.c | 183 ------------------------------- drivers/infiniband/sw/rxe/rxe_loc.h | 2 - drivers/infiniband/sw/rxe/rxe_verbs.c | 3 +- include/rdma/ib_verbs.h | 103 ++---------------- 13 files changed, 18 insertions(+), 542 deletions(-) delete mode 100644 drivers/infiniband/sw/rdmavt/dma.c delete mode 100644 drivers/infiniband/sw/rdmavt/dma.h delete mode 100644 drivers/infiniband/sw/rxe/rxe_dma.cdrivers/infiniband/sw/rdmavt/Kconfig +0
-0
drivers/infiniband/sw/rdmavt/Kconfig line 4
Quoted 4 lines
drivers/infiniband/sw/rdmavt/Kconfig +1
-0@@ -1,5 +1,6 @@ config INFINIBAND_RDMAVT tristate "RDMA verbs transport library" depends on 64BIT + select DMA_VIRT_OPS
Bart,
Small question, is it an easy way to select this option for whole INFINIBAND instead of doing for every driver?
Besides that,
A message that is not in the archive (sent off-list or not yet received): 20170122141141.GI28570-U/[email protected]
Re: [PATCH v3 37/37] IB/rxe, IB/rdmavt: Use dma_virt_ops instead of duplicating it
T24gU3VuLCAyMDE3LTAxLTIyIGF0IDE2OjExICswMjAwLCBMZW9uIFJvbWFub3Zza3kgd3JvdGU6 DQo+ID4gZGlmZiAtLWdpdCBhL2RyaXZlcnMvaW5maW5pYmFuZC9zdy9yZG1hdnQvS2NvbmZpZyBi L2RyaXZlcnMvaW5maW5pYmFuZC9zdy9yZG1hdnQvS2NvbmZpZw0KPiA+IGluZGV4IDFkYThkMDFh Njg1NS4uZmRkMDAxY2UxM2Q4IDEwMDY0NA0KPiA+IC0tLSBhL2RyaXZlcnMvaW5maW5pYmFuZC9z dy9yZG1hdnQvS2NvbmZpZw0KPiA+ICsrKyBiL2RyaXZlcnMvaW5maW5pYmFuZC9zdy9yZG1hdnQv S2NvbmZpZw0KPiA+IEBAIC0xLDUgKzEsNiBAQA0KPiA+ICBjb25maWcgSU5GSU5JQkFORF9SRE1B VlQNCj4gPiAgCXRyaXN0YXRlICJSRE1BIHZlcmJzIHRyYW5zcG9ydCBsaWJyYXJ5Ig0KPiA+ICAJ ZGVwZW5kcyBvbiA2NEJJVA0KPiA+ICsJc2VsZWN0IERNQV9WSVJUX09QUw0KPiANCj4gQmFydCwN Cj4gU21hbGwgcXVlc3Rpb24sIGlzIGl0IGFuIGVhc3kgd2F5IHRvIHNlbGVjdCB0aGlzIG9wdGlv bg0KPiBmb3Igd2hvbGUgSU5GSU5JQkFORCBpbnN0ZWFkIG9mIGRvaW5nIGZvciBldmVyeSBkcml2 ZXI/DQoNCkhlbGxvIExlb24sDQoNCmRtYV92aXJ0X29wcyBpcyB1c2VkIGJ5IG9ubHkgdGhyZWUg UkRNQSBkcml2ZXJzIChoZmkxLCBxaWIgYW5kIHJ4ZSkuIFNvIEknbQ0Kbm90IHN1cmUgd2h5IHlv dSB3b3VsZCBsaWtlIHRvIHNlbGVjdCBETUFfVklSVF9PUFMgZm9yIGFsbCBSRE1BIEhCQSBkcml2 ZXJzPw0KDQpCYXJ0Lg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Boyer, Andrew
Reviewed-byRe: [PATCH v3 37/37] IB/rxe, IB/rdmavt: Use dma_virt_ops instead of duplicating it
In reply to a message not in the archiveQuoted 27 lines · Bart Van Assche
Make the rxe and rdmavt drivers use
dma_virt_ops. Update the comments that refer to the source files removed by this patch. Remove structib_dma_mapping_ops. Remove ib_device.dma_ops.Signed-off-by Bart Van Assche <[email protected]>Cc Andrew Boyer <[email protected]>Cc Dennis Dalessandro <[email protected]>Cc Jonathan Toppins <[email protected]>Cc Alex Estrin <[email protected]>Cc Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>---
drivers/infiniband/sw/rdmavt/Kconfig | 1 + drivers/infiniband/sw/rdmavt/Makefile | 2 +- drivers/infiniband/sw/rdmavt/dma.c | 198 ---------------------------------- drivers/infiniband/sw/rdmavt/dma.h | 53 --------- drivers/infiniband/sw/rdmavt/mr.c | 8 +- drivers/infiniband/sw/rdmavt/vt.c | 4 +- drivers/infiniband/sw/rdmavt/vt.h | 1 - drivers/infiniband/sw/rxe/Kconfig | 1 + drivers/infiniband/sw/rxe/Makefile | 1 - drivers/infiniband/sw/rxe/rxe_dma.c | 183 ------------------------------- drivers/infiniband/sw/rxe/rxe_loc.h | 2 - drivers/infiniband/sw/rxe/rxe_verbs.c | 3 +- include/rdma/ib_verbs.h | 103 ++---------------- 13 files changed, 18 insertions(+), 542 deletions(-)
Quoted 3 lines
delete mode 100644
drivers/infiniband/sw/rdmavt/dma.cdelete mode 100644drivers/infiniband/sw/rdmavt/dma.hdelete mode 100644drivers/infiniband/sw/rxe/rxe_dma.c
For the RXE/ib_verbs portions -
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Laurence Oberman
Tested-by----- Original Message -----
Quoted 258 lines
From: "Bart Van Assche" <[email protected]>
To: "Doug Ledford" <[email protected]>
Cc: [email protected], "Bart Van Assche" <[email protected]>
Sent: Friday, January 20, 2017 4:04:00 PM
Subject: [PATCH v3 00/37] IB: Optimize DMA mappingHello Doug,
As you know there are two sets of DMA mapping operations in the Linux kernel:
- One set of DMA mapping operations that is used by most drivers.
- Another set of DMA mapping operations that is only used by the RDMA drivers.
Having two types of DMA mapping operations is not only a source of confusion but also a source of unnecessary overhead. The DMA mapping operations are in the hot path so it is important that the overhead of these operations is as low as possible. Hence this patch series that converts the RDMA code to the standard DMA mapping operations and thereby eliminates the if (dev->dma_ops) test from the hot path.The changes compared to version 2 of this patch series are:
- Left out the inlining of the ib_dma_map_*() functions to keep the number of patches in this patch series reasonable.
- Reworked this patch series such that (hopefully) the hfi1 and qib drivers keep working.The changes compared to version 1 of this patch series are:
- Patch "Movedma_opsfrom archdata into struct device" has been split into three patches.
- Patch "treewide: Inline ib_dma_map_*() functions" has been split into 15 patches (one per driver).
- A patch has been added that buildsdma_noop_opsonly for the architectures that need it.
- The newdma_virt_opsis only built if it is used by a driver.
- In these last 15 patches indentation has been adjusted to keep the arguments aligned with the opening parenthesis.Bart Van Assche (37):
treewide: Constify mostdma_map_opsstructures
treewide: Movedma_opsfrom structdev_archdatainto struct device
treewide: Consolidateset_dma_ops()implementations
treewide: Consolidateget_dma_ops()implementationslib/dma-noop: Clarify a comment
lib/dma-noop: Only builddma_noop_opsfor s390 and m32rlib/dma-virt: Adddma_virt_ops
IB/core: Remove ib_dma_*map_single_attrs()
RDS: IB: Remove an unused structure member
IB/core: Change the type of anib_dma_alloc_coherent()argument IB/hf1: Remove DMA mapping code
IB/qib: Remove DMA mapping code
IB/core: Initialize ib_device.dev.parent earlier IB/core: Use dev.parent instead ofdma_device
IB/cxgb3: Set dev.parent instead ofdma_deviceIB/cxgb4: Set dev.parent instead ofdma_device
IB/hfi1: Switch fromdma_deviceto dev.parent
IB/hns: Switch fromdma_deviceto dev.parent
IB/i40iw: Remove a superfluous assignment statement IB/mlx4: Switch fromdma_deviceto dev.parent
IB/mlx5: Switch fromdma_deviceto dev.parent
IB/mthca: Switch fromdma_deviceto dev.parent
IB/nes: Remove a superfluous assignment statement IB/ocrdma: Switch fromdma_deviceto dev.parent IB/qedr: Switch fromdma_deviceto dev.parent
IB/qib: Switch fromdma_deviceto dev.parent
IB/usnic: Switch fromdma_deviceto dev.parent IB/vmw_pvrdma: Switch fromdma_deviceto dev.parent IB/rxe: Switch fromdma_deviceto dev.parent
IB/IPoIB: Switch fromdma_deviceto dev.parent
IB/iser: Switch fromdma_deviceto dev.parent
IB/srp: Switch fromdma_deviceto dev.parent
IB/srpt: Modify a debug statement
RDS: net: Switch fromdma_deviceto dev.parent
nvme-rdma: Switch fromdma_deviceto dev.parent IB/core: Remove ib_device.dma_device
IB/rxe, IB/rdmavt: Usedma_virt_opsinstead of duplicating itarch/alpha/include/asm/dma-mapping.h | 4 +- arch/alpha/kernel/pci-noop.c | 4 +- arch/alpha/kernel/pci_iommu.c | 4 +- arch/arc/include/asm/dma-mapping.h | 4 +- arch/arc/mm/dma.c | 2 +- arch/arm/common/dmabounce.c | 2 +- arch/arm/include/asm/device.h | 1 - arch/arm/include/asm/dma-mapping.h | 20 +-- arch/arm/mm/dma-mapping.c | 22 +-- arch/arm/xen/mm.c | 4 +- arch/arm64/include/asm/device.h | 1 - arch/arm64/include/asm/dma-mapping.h | 12 +- arch/arm64/mm/dma-mapping.c | 14 +- arch/avr32/include/asm/dma-mapping.h | 4 +- arch/avr32/mm/dma-coherent.c | 2 +- arch/blackfin/include/asm/dma-mapping.h | 4 +- arch/blackfin/kernel/dma-mapping.c | 2 +- arch/c6x/include/asm/dma-mapping.h | 4 +- arch/c6x/kernel/dma.c | 2 +- arch/cris/arch-v32/drivers/pci/dma.c | 2 +- arch/cris/include/asm/dma-mapping.h | 6 +- arch/frv/include/asm/dma-mapping.h | 4 +- arch/frv/mb93090-mb00/pci-dma-nommu.c | 2 +- arch/frv/mb93090-mb00/pci-dma.c | 2 +- arch/h8300/include/asm/dma-mapping.h | 4 +- arch/h8300/kernel/dma.c | 2 +- arch/hexagon/include/asm/dma-mapping.h | 7 +- arch/hexagon/kernel/dma.c | 4 +- arch/ia64/hp/common/hwsw_iommu.c | 4 +- arch/ia64/hp/common/sba_iommu.c | 4 +- arch/ia64/include/asm/dma-mapping.h | 7 +- arch/ia64/include/asm/machvec.h | 4 +- arch/ia64/kernel/dma-mapping.c | 4 +- arch/ia64/kernel/pci-dma.c | 10 +- arch/ia64/kernel/pci-swiotlb.c | 2 +- arch/m32r/Kconfig | 1 + arch/m32r/include/asm/device.h | 1 - arch/m32r/include/asm/dma-mapping.h | 4 +- arch/m68k/include/asm/dma-mapping.h | 4 +- arch/m68k/kernel/dma.c | 2 +- arch/metag/include/asm/dma-mapping.h | 4 +- arch/metag/kernel/dma.c | 2 +- arch/microblaze/include/asm/dma-mapping.h | 4 +- arch/microblaze/kernel/dma.c | 2 +- arch/mips/cavium-octeon/dma-octeon.c | 4 +- arch/mips/include/asm/device.h | 5 - arch/mips/include/asm/dma-mapping.h | 9 +- .../include/asm/mach-cavium-octeon/dma-coherence.h | 2 +- arch/mips/include/asm/netlogic/common.h | 2 +- arch/mips/loongson64/common/dma-swiotlb.c | 2 +- arch/mips/mm/dma-default.c | 4 +- arch/mips/netlogic/common/nlm-dma.c | 2 +- arch/mips/pci/pci-octeon.c | 2 +- arch/mn10300/include/asm/dma-mapping.h | 4 +- arch/mn10300/mm/dma-alloc.c | 2 +- arch/nios2/include/asm/dma-mapping.h | 4 +- arch/nios2/mm/dma-mapping.c | 2 +- arch/openrisc/include/asm/dma-mapping.h | 4 +- arch/openrisc/kernel/dma.c | 2 +- arch/parisc/include/asm/dma-mapping.h | 8 +- arch/parisc/kernel/drivers.c | 2 +- arch/parisc/kernel/pci-dma.c | 4 +- arch/powerpc/include/asm/device.h | 4 - arch/powerpc/include/asm/dma-mapping.h | 14 +- arch/powerpc/include/asm/pci.h | 4 +- arch/powerpc/include/asm/ps3.h | 2 +- arch/powerpc/include/asm/swiotlb.h | 2 +- arch/powerpc/kernel/dma-swiotlb.c | 2 +- arch/powerpc/kernel/dma.c | 8 +- arch/powerpc/kernel/pci-common.c | 6 +- arch/powerpc/platforms/cell/iommu.c | 6 +- arch/powerpc/platforms/pasemi/iommu.c | 2 +- arch/powerpc/platforms/pasemi/setup.c | 2 +- arch/powerpc/platforms/powernv/npu-dma.c | 2 +- arch/powerpc/platforms/ps3/system-bus.c | 8 +- arch/powerpc/platforms/pseries/ibmebus.c | 4 +- arch/powerpc/platforms/pseries/vio.c | 2 +- arch/s390/Kconfig | 1 + arch/s390/include/asm/device.h | 1 - arch/s390/include/asm/dma-mapping.h | 6 +- arch/s390/pci/pci.c | 2 +- arch/s390/pci/pci_dma.c | 2 +- arch/sh/include/asm/dma-mapping.h | 4 +- arch/sh/kernel/dma-nommu.c | 2 +- arch/sh/mm/consistent.c | 2 +- arch/sparc/include/asm/dma-mapping.h | 10 +- arch/sparc/kernel/iommu.c | 4 +- arch/sparc/kernel/ioport.c | 8 +- arch/sparc/kernel/pci_sun4v.c | 2 +- arch/tile/include/asm/device.h | 3 - arch/tile/include/asm/dma-mapping.h | 20 +-- arch/tile/kernel/pci-dma.c | 24 +-- arch/unicore32/include/asm/dma-mapping.h | 4 +- arch/unicore32/mm/dma-swiotlb.c | 2 +- arch/x86/include/asm/device.h | 5 +- arch/x86/include/asm/dma-mapping.h | 11 +- arch/x86/include/asm/iommu.h | 2 +- arch/x86/kernel/amd_gart_64.c | 2 +- arch/x86/kernel/pci-calgary_64.c | 6 +- arch/x86/kernel/pci-dma.c | 4 +- arch/x86/kernel/pci-nommu.c | 2 +- arch/x86/kernel/pci-swiotlb.c | 2 +- arch/x86/pci/common.c | 2 +- arch/x86/pci/sta2x11-fixup.c | 10 +- arch/x86/xen/pci-swiotlb-xen.c | 2 +- arch/xtensa/include/asm/device.h | 4 - arch/xtensa/include/asm/dma-mapping.h | 9 +- arch/xtensa/kernel/pci-dma.c | 2 +- drivers/infiniband/core/device.c | 9 + drivers/infiniband/core/sysfs.c | 2 +- drivers/infiniband/core/ucm.c | 2 +- drivers/infiniband/core/user_mad.c | 4 +- drivers/infiniband/core/uverbs_main.c | 2 +- drivers/infiniband/hw/cxgb3/iwch_provider.c | 2 +- drivers/infiniband/hw/cxgb4/provider.c | 2 +- drivers/infiniband/hw/hfi1/dma.c | 183 ------------------- drivers/infiniband/hw/hfi1/mad.c | 2 +- drivers/infiniband/hw/hfi1/verbs.c | 2 +- drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +- drivers/infiniband/hw/i40iw/i40iw_verbs.c | 1 - drivers/infiniband/hw/mlx4/main.c | 2 +- drivers/infiniband/hw/mlx4/mlx4_ib.h | 2 +- drivers/infiniband/hw/mlx4/mr.c | 6 +- drivers/infiniband/hw/mlx5/main.c | 2 +- drivers/infiniband/hw/mlx5/mr.c | 14 +- drivers/infiniband/hw/mthca/mthca_provider.c | 2 +- drivers/infiniband/hw/nes/nes_verbs.c | 1 - drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- drivers/infiniband/hw/qedr/main.c | 2 +- drivers/infiniband/hw/qib/qib_dma.c | 169 ------------------ drivers/infiniband/hw/qib/qib_keys.c | 5 +- drivers/infiniband/hw/qib/qib_verbs.c | 2 +- drivers/infiniband/hw/usnic/usnic_ib_main.c | 2 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +- drivers/infiniband/sw/rdmavt/Kconfig | 1 + drivers/infiniband/sw/rdmavt/Makefile | 2 +- drivers/infiniband/sw/rdmavt/dma.c | 198 --------------------- drivers/infiniband/sw/rdmavt/dma.h | 53 ------ drivers/infiniband/sw/rdmavt/mr.c | 8 +- drivers/infiniband/sw/rdmavt/vt.c | 4 +- drivers/infiniband/sw/rdmavt/vt.h | 1 - drivers/infiniband/sw/rxe/Kconfig | 1 + drivers/infiniband/sw/rxe/Makefile | 1 - drivers/infiniband/sw/rxe/rxe_dma.c | 183 ------------------- drivers/infiniband/sw/rxe/rxe_loc.h | 2 - drivers/infiniband/sw/rxe/rxe_verbs.c | 9 +- drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +- drivers/infiniband/ulp/srp/ib_srp.c | 4 +- drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +- drivers/iommu/amd_iommu.c | 10 +- drivers/misc/mic/bus/mic_bus.c | 4 +- drivers/misc/mic/bus/scif_bus.c | 4 +- drivers/misc/mic/bus/scif_bus.h | 2 +- drivers/misc/mic/bus/vop_bus.c | 2 +- drivers/misc/mic/host/mic_boot.c | 4 +- drivers/nvme/host/rdma.c | 2 +- drivers/parisc/ccio-dma.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/pci/host/vmd.c | 2 +- include/linux/device.h | 1 + include/linux/dma-mapping.h | 55 +++--- include/linux/mic_bus.h | 2 +- include/rdma/ib_verbs.h | 143 ++------------- include/xen/arm/hypervisor.h | 2 +- lib/Kconfig | 10 ++ lib/Makefile | 3 +- lib/dma-noop.c | 4 +- lib/dma-virt.c | 72 ++++++++ net/rds/ib.h | 8 +- net/rds/ib_mr.h | 1 - 173 files changed, 437 insertions(+), 1298 deletions(-) delete mode 100644 drivers/infiniband/hw/hfi1/dma.c delete mode 100644 drivers/infiniband/hw/qib/qib_dma.c delete mode 100644 drivers/infiniband/sw/rdmavt/dma.c delete mode 100644 drivers/infiniband/sw/rdmavt/dma.h delete mode 100644 drivers/infiniband/sw/rxe/rxe_dma.c create mode 100644 lib/dma-virt.c
Quoted 8 lines
--
2.11.0--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello Bart, if this the match to what you shared with me earlier I have tested the IB/SRP part of this series.
This is the IB/RDMA/SRP stack, testing both ib_srp and ib_srpt.
1. Tested direct and buffered read I/O with 4MB I/O and smaller I/O sizes direct to mpath devices
2. Tested read and write I/O with 4MB and smaller I/O to XFS file systems.
3. Removed a SRP paths one by one and let then reconnect with no issues
All my tests were SRP using connectX-4 (mlx5) at EDR (100G)
For: Optimize DMA mapping tree, branch for next from latest copy on:
https://github.com/bvanassche/linux
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1671405275.19009584.1484949453215.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Quoted 10 lines · Laurence Oberman
Hello Bart, if this the match to what you shared with me earlier I have tested the IB/SRP part of this series.
This is the IB/RDMA/SRP stack, testing both
ib_srpandib_srpt.1. Tested direct and buffered read I/O with 4MB I/O and smaller I/O sizes direct to mpath devices
2. Tested read and write I/O with 4MB and smaller I/O to XFS file systems.
3. Removed a SRP paths one by one and let then reconnect with no issues
Quoted 5 lines
All my tests were SRP using connectX-4 (mlx5) at EDR (100G)
For: Optimize DMA mapping tree, branch for next from latest copy on:
https://github.com/bvanassche/linuxTested-by Laurence Oberman <[email protected]>
Hello Laurence,
The code I posted is identical to the code I asked you to test. Thanks for the help with testing!
I tested the following ULP and HBA drivers myself with this patch series:ib_srp, ib_srpt, ib_mlx4 and rxe.
Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
----- Original Message -----
Quoted 25 lines
From: "Bart Van Assche" <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
Sent: Friday, January 20, 2017 5:18:59 PM
Subject: Re: [PATCH v3 00/37] IB: Optimize DMA mappingQuoted 10 lines · Laurence Oberman
Hello Bart, if this the match to what you shared with me earlier I have tested the IB/SRP part of this series.
This is the IB/RDMA/SRP stack, testing both
ib_srpandib_srpt.1. Tested direct and buffered read I/O with 4MB I/O and smaller I/O sizes direct to mpath devices
2. Tested read and write I/O with 4MB and smaller I/O to XFS file systems.
3. Removed a SRP paths one by one and let then reconnect with no issuesQuoted 5 lines
All my tests were SRP using connectX-4 (mlx5) at EDR (100G)
For: Optimize DMA mapping tree, branch for next from latest copy on:
https://github.com/bvanassche/linuxTested-by Laurence Oberman <[email protected]>Hello Laurence,
Quoted 7 lines
The code I posted is identical to the code I asked you to test. Thanks for the help with testing!
I tested the following ULP and HBA drivers myself with this patch series:
ib_srp,ib_srpt,ib_mlx4and rxe.Bart.
OK, good, I guess I should add mlx5_ib to my list as its implied. Thanks !! so much for all this work you do in this space.
Regards
Laurence
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 20 lines · Bart Van Assche
Hello Doug,
As you know there are two sets of DMA mapping operations in the Linux kernel:
- One set of DMA mapping operations that is used by most drivers.
- Another set of DMA mapping operations that is only used by the RDMA drivers.
Having two types of DMA mapping operations is not only a source of confusion but also a source of unnecessary overhead. The DMA mapping operations are in the hot path so it is important that the overhead of these operations is as low as possible. Hence this patch series that converts the RDMA code to the standard DMA mapping operations and thereby eliminates the if (dev->dma_ops) test from the hot path.The changes compared to version 2 of this patch series are:
- Left out the inlining of the ib_dma_map_*() functions to keep the number of patches in this patch series reasonable.
- Reworked this patch series such that (hopefully) the hfi1 and qib drivers keep working.
Quoted 10 lines
The changes compared to version 1 of this patch series are:
- Patch "Movedma_opsfrom archdata into struct device" has been split into three patches.
- Patch "treewide: Inline ib_dma_map_*() functions" has been split into 15 patches (one per driver).
- A patch has been added that buildsdma_noop_opsonly for the architectures that need it.
- The newdma_virt_opsis only built if it is used by a driver.
- In these last 15 patches indentation has been adjusted to keep the arguments aligned with the opening parenthesis.
Hi Bart,
I think this has enough Acks to move foward (especially from the larger kernel community on the core kernel bits, such as GKH's ack on the core bits). I've pulled it into a branch (there were a few fixups I had to do, compile testing that now). However, I'm going to wait until the very end to merge this branch right before my pull request. That way if Linus has any objections, he can just pop the top 37 patches off of my pull request and effectively remove this patchset, at which point we can fix up whatever he objected to and resubmit. And I'm only doing that because of the number of patches that are either outside of drivers/infiniband or treewide in this series.
Signature · 4 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
A message that is not in the archive (sent off-list or not yet received): 1485279487.43764.38.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Quoted 10 lines · Doug Ledford
I think this has enough Acks to move foward (especially from the larger kernel community on the core kernel bits, such as GKH's ack on the core bits). I've pulled it into a branch (there were a few fixups I had to do, compile testing that now). However, I'm going to wait until the very end to merge this branch right before my pull request. That way if Linus has any objections, he can just pop the top 37 patches off of my pull request and effectively remove this patchset, at which point we can fix up whatever he objected to and resubmit. And I'm only doing that because of the number of patches that are either outside of
drivers/infinibandor treewide in this series.
Hello Doug,
Waiting with a big patch series until the end of the merge window is the traditional approach. A quote from https://lwn.net/Articles/585782/:
"Shortly after the -rc1 release is a good time for this, though it is best to agree on this timing ahead of time." This makes me wonder whether we should contact Linus before the next merge window opens?
Thanks,
Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Bart Van Assche
Waiting with a big patch series until the end of the merge window is the traditional approach. A quote from https://lwn.net/Articles/585782/:
"Shortly after the -rc1 release is a good time for this, though it is best to agree on this timing ahead of time." This makes me wonder whether we should contact Linus before the next merge window opens?
Yes. Keep it in a separate branch that still goes into linux-next, send him a headsup with the first pull request.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html