iommu: Move iommu_group_create_direct_mappings() out of iommu_group_add_device()
authorJoerg Roedel <jroedel@suse.de>
Wed, 29 Apr 2020 13:36:50 +0000 (15:36 +0200)
committerJoerg Roedel <jroedel@suse.de>
Tue, 5 May 2020 12:36:13 +0000 (14:36 +0200)
commitce574c27ae275bc51b6437883fc9cd1c46b498e5
treea51e2a432938bb3565ec4f75a2348002a818221f
parentdeac0b3bed26bb5d04486696b1071d8ec3851100
iommu: Move iommu_group_create_direct_mappings() out of iommu_group_add_device()

After the previous changes the iommu group may not have a default
domain when iommu_group_add_device() is called. With no default domain
iommu_group_create_direct_mappings() will do nothing and no direct
mappings will be created.

Rename iommu_group_create_direct_mappings() to
iommu_create_device_direct_mappings() to better reflect that the
function creates direct mappings only for one device and not for all
devices in the group. Then move the call to the places where a default
domain actually exists.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20200429133712.31431-13-joro@8bytes.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c