mirror of
https://github.com/torvalds/linux.git
synced 2026-06-10 15:42:19 +02: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:
parent
f9613e3a3c
commit
502e1d32f2
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user