mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
iommu: Don't break iommu_attach_device() if iommu shared by more than one master
Don't break iommu_attach_device. iommu_attach_device will break if iommu shared by two or more masters Change-Id: Ifd1c652341e2270bfde57ebe1e0cd00d51d38eec Signed-off-by: Simon Xue <xxm@rock-chips.com>
This commit is contained in:
@@ -1962,7 +1962,9 @@ int iommu_attach_device(struct iommu_domain *domain, struct device *dev)
|
||||
*/
|
||||
mutex_lock(&group->mutex);
|
||||
ret = -EINVAL;
|
||||
if (iommu_group_device_count(group) != 1)
|
||||
|
||||
/* don't break attach if iommu shared by more than one master */
|
||||
if (iommu_group_device_count(group) < 1)
|
||||
goto out_unlock;
|
||||
|
||||
ret = __iommu_attach_group(domain, group);
|
||||
|
||||
Reference in New Issue
Block a user