Skip to content

Let IOMMU core know about individual IOMMUs

Joerg Roedel linux-arm-kernel linux-devicetree linux-iommu linux-mediatek linux-samsung-soc lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest11 patches 15 repliesIn review
  2. v210 patches 3 repliesSuperseded
  3. v110 patches 0 repliesSuperseded

Changes in v3 from the cover letter

* Fixed build issues resulting from wrong patch order, everything should be nicely bisectable now
* Introduced wrapper functions around 'struct iommu_device' members, to keep the struct empty when !CONFIG_IOMMU_API
* Renamed the iommu-devices on Exynos as suggested by Marek Szyprowski

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11iommu: Rename iommu_get_instance()drivers/acpi/arm64/iort.c drivers/iommu/iommu.c include/linux/iommu.h +1 more+5 -52 replies
2/11iommu: Rename struct iommu_devicedrivers/iommu/iommu.c+5 -50 replies
3/11iommu: Introduce new 'struct iommu_device'drivers/iommu/amd_iommu.c drivers/iommu/amd_iommu_init.c drivers/iommu/amd_iommu_types.h +5 more+71 -100 replies
4/11iommu: Add sysfs bindings for struct iommu_devicedrivers/iommu/amd_iommu.c drivers/iommu/amd_iommu_init.c drivers/iommu/amd_iommu_types.h +5 more+62 -580 replies
5/11iommu: Make iommu_device_link/unlink take a struct iommu_devicedrivers/iommu/amd_iommu.c drivers/iommu/intel-iommu.c drivers/iommu/iommu-sysfs.c +1 more+14 -140 replies
6/11iommu: Add iommu_device_set_fwnode() interfaceinclude/linux/iommu.h+12 -05 replies
7/11iommu/arm-smmu: Make use of the iommu_register interfacedrivers/iommu/arm-smmu-v3.c drivers/iommu/arm-smmu.c+51 -13 replies
8/11iommu/msm: Make use of iommu_device_register interfacedrivers/iommu/msm_iommu.c drivers/iommu/msm_iommu.h+76 -03 replies
9/11iommu/mediatek: Make use of iommu_device_register interfacedrivers/iommu/mtk_iommu.c drivers/iommu/mtk_iommu.h+28 -00 replies
10/11iommu/exynos: Make use of iommu_device_register interfacedrivers/iommu/exynos-iommu.c+14 -02 replies
11/11iommu: Remove iommu_register_instance interfacedrivers/iommu/arm-smmu-v3.c drivers/iommu/arm-smmu.c drivers/iommu/exynos-iommu.c +5 more+6 -520 replies

Reviews trailers per patch

1 of 11 patches has a Reviewed-by or Acked-by.

PatchMarek Szyprowski
1/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11
10/11A-b T-b
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH 00/11 v3] Let IOMMU core know about individual IOMMUs

Changes since v2:

* Fixed build issues resulting from wrong patch order, everything should be nicely bisectable now
* Introduced wrapper functions around 'struct iommu_device' members, to keep the struct empty when !CONFIG_IOMMU_API
* Renamed the iommu-devices on Exynos as suggested by Marek Szyprowski

Changes since v1:

* Rebased to v4.10-rc7
* Fixed build failures found by the
kbuild test robot

Hi,

the IOMMU core code already has two ways of representing individual hardware IOMMUs. One is the sysfs code and the other is the newer iommu_register_instance interface. These two interfaces are special purpose and can be unified.

This unification is attempted in this patch-set. It introduces an extensible 'struct iommu_device' which represents a hardware IOMMU in the IOMMU core code.

For now the struct contains a pointer to the iommu_ops, which is a step to get rid of the per-bus iommu_ops, and a pointer to a firmware-node structure.

The patches have been tested on x86 hardware and an AMD Seattle ARM64 system.

Please review, test and provide feedback!

Thanks a lot,

Joerg

Joerg Roedel (11):
iommu: Rename iommu_get_instance()
iommu: Rename struct iommu_device
iommu: Introduce new 'struct iommu_device'
iommu: Add sysfs bindings for struct iommu_device
iommu: Make iommu_device_link/unlink take a struct iommu_device
iommu: Add iommu_device_set_fwnode() interface iommu/arm-smmu: Make use of the iommu_register interface iommu/msm: Make use of iommu_device_register interface iommu/mediatek: Make use of iommu_device_register interface iommu/exynos: Make use of iommu_device_register interface
iommu: Remove iommu_register_instance interface

 drivers/acpi/arm64/iort.c       |  2 +-
 drivers/iommu/amd_iommu.c       | 18 +++++----
 drivers/iommu/amd_iommu_init.c  |  9 +++--
 drivers/iommu/amd_iommu_types.h |  4 +-
 drivers/iommu/arm-smmu-v3.c     | 22 ++++++++++-
 drivers/iommu/arm-smmu.c        | 31 ++++++++++++++-
 drivers/iommu/dmar.c            | 20 ++++++----
 drivers/iommu/exynos-iommu.c    | 16 +++++++-
 drivers/iommu/intel-iommu.c     | 19 +++++----
 drivers/iommu/iommu-sysfs.c     | 61 +++++++++++++----------------
 drivers/iommu/iommu.c           | 68 +++++++++++++++------------------
 drivers/iommu/msm_iommu.c       | 73 ++++++++++++++++++++++++++++++++++-
 drivers/iommu/msm_iommu.h       |  3 ++
 drivers/iommu/mtk_iommu.c       | 27 ++++++++++++-
 drivers/iommu/mtk_iommu.h       |  2 +
 include/linux/intel-iommu.h     |  3 +-
 include/linux/iommu.h           | 85 +++++++++++++++++++++++++++++++----------
 include/linux/of_iommu.h        |  8 +---
 18 files changed, 335 insertions(+), 136 deletions(-)
Signature · 1 line
1.9.1