linux-stable/drivers/iommu
Jason Gunthorpe 83b3836bf8 iommu: Allow ops->default_domain to work when !CONFIG_IOMMU_DMA
The ops->default_domain flow used a 0 req_type to select the default
domain and this was enforced by iommu_group_alloc_default_domain().

When !CONFIG_IOMMU_DMA started forcing the old ARM32 drivers into IDENTITY
it also overroad the 0 req_type of the ops->default_domain drivers to
IDENTITY which ends up causing failures during device probe.

Make iommu_group_alloc_default_domain() accept a req_type that matches the
ops->default_domain and have iommu_group_alloc_default_domain() generate a
req_type that matches the default_domain.

This way the req_type always describes what kind of domain should be
attached and ops->default_domain overrides all other mechanisms to choose
the default domain.

Fixes: 2ad56efa80 ("powerpc/iommu: Setup a default domain and remove set_platform_dma_ops")
Fixes: 0f6a90436a ("iommu: Do not use IOMMU_DOMAIN_DMA if CONFIG_IOMMU_DMA is not enabled")
Reported-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Closes: https://lore.kernel.org/linux-iommu/20240123165829.630276-1-ovidiu.panait@windriver.com/
Reported-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Closes: https://lore.kernel.org/linux-iommu/170618452753.3805.4425669653666211728.stgit@ltcd48-lp2.aus.stglab.ibm.com/
Tested-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Tested-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/0-v1-755bd21c4a64+525b8-iommu_def_dom_fix_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2024-02-01 13:16:17 +01:00
..
amd IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
arm IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
intel iommufd for 6.8 2024-01-18 15:28:15 -08:00
iommufd iommufd for 6.8 2024-01-18 15:28:15 -08:00
Kconfig iommu: Change kconfig around IOMMU_SVA 2023-12-12 10:11:27 +01:00
Makefile iommu/tegra-gart: Remove tegra-gart 2023-09-25 11:40:54 +02:00
apple-dart.c Merge branches 'apple/dart', 'arm/rockchip', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2024-01-03 09:59:32 +01:00
dma-iommu.c IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
dma-iommu.h iommu: Optimise PCI SAC address trick 2023-07-14 16:14:17 +02:00
exynos-iommu.c iommu/exynos: Update to {map,unmap}_pages 2023-09-25 12:04:36 +02:00
fsl_pamu.c iommu/fsl: fix all kernel-doc warnings in fsl_pamu.c 2023-03-22 14:50:15 +01:00
fsl_pamu.h
fsl_pamu_domain.c iommu/fsl_pamu: Implement a PLATFORM domain 2023-09-25 11:40:54 +02:00
fsl_pamu_domain.h
hyperv-iommu.c x86/vector: Rename send_cleanup_vector() to vector_schedule_cleanup() 2023-08-06 14:15:09 +02:00
io-pgfault.c iommu: Rename iommu-sva-lib.{c,h} 2022-11-03 15:47:54 +01:00
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Remove map/unmap 2022-11-19 10:44:15 +01:00
io-pgtable-arm.c iommu: Extend LPAE page table format to support custom allocators 2023-11-27 11:10:12 +01:00
io-pgtable-arm.h
io-pgtable-dart.c iommu/io-pgtable-dart: Add DART PTE support for t6000 2022-09-26 13:49:40 +02:00
io-pgtable.c iommu: Allow passing custom allocators to pgtable drivers 2023-11-27 11:10:12 +01:00
iommu-debugfs.c
iommu-priv.h iommu: Move dev_iommu_ops() to private header 2023-08-18 12:52:15 -03:00
iommu-sva.c iommu/sva: Fix memory leak in iommu_sva_bind_device() 2023-12-15 09:06:49 +01:00
iommu-sva.h iommu: Remove ioasid infrastructure 2023-03-31 10:03:31 +02:00
iommu-sysfs.c iommu: Do not export iommu_device_link/unlink() 2023-07-14 16:14:15 +02:00
iommu-traces.c iommu: Remove detach_dev callback 2023-01-13 16:39:18 +01:00
iommu.c iommu: Allow ops->default_domain to work when !CONFIG_IOMMU_DMA 2024-02-01 13:16:17 +01:00
iova.c iommu/iova: Manage the depot list size 2023-09-25 12:07:44 +02:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Convert to generic_single_device_group() 2023-09-25 11:51:07 +02:00
irq_remapping.c
irq_remapping.h
msm_iommu.c iommu: Allow .iotlb_sync_map to fail and handle s390's -ENOMEM return 2023-10-02 08:42:57 +02:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu: Clean up open-coded ownership checks 2023-11-27 11:03:16 +01:00
mtk_iommu_v1.c iommu: Clean up open-coded ownership checks 2023-11-27 11:03:16 +01:00
of_iommu.c Merge branches 'apple/dart', 'arm/rockchip', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2024-01-03 09:59:32 +01:00
omap-iommu-debug.c iommu/omap: Fix buffer overflow in debugfs 2022-09-07 10:42:28 +02:00
omap-iommu.c iommu: Mark dev_iommu_priv_set() with a lockdep 2023-12-12 10:18:49 +01:00
omap-iommu.h iommu/omap: Convert to generic_single_device_group() 2023-09-25 11:52:08 +02:00
omap-iopgtable.h
rockchip-iommu.c iommu/rockchip: Update to {map,unmap}_pages 2023-09-25 12:04:37 +02:00
s390-iommu.c iommu/dma: Allow a single FQ in addition to per-CPU FQs 2023-10-02 08:43:03 +02:00
sprd-iommu.c iommu: Clean up open-coded ownership checks 2023-11-27 11:03:16 +01:00
sun50i-iommu.c iommu: Allow .iotlb_sync_map to fail and handle s390's -ENOMEM return 2023-10-02 08:42:57 +02:00
tegra-smmu.c Merge branches 'iommu/fixes', 'arm/tegra', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd', 'core' and 's390' into next 2023-10-27 09:13:40 +02:00
virtio-iommu.c Merge branches 'apple/dart', 'arm/rockchip', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2024-01-03 09:59:32 +01:00