iommu: don't break detach if iommu shared by more than one master

Change-Id: I4fade6e770e124dcaca41d122965e8696f268556
Signed-off-by: Simon Xue <xxm@rock-chips.com>
This commit is contained in:
Simon Xue
2020-09-08 16:05:54 +08:00
committed by Tao Huang
parent c6e7c35ce4
commit 56a06f65ac

View File

@@ -1404,7 +1404,8 @@ void iommu_detach_device(struct iommu_domain *domain, struct device *dev)
return;
mutex_lock(&group->mutex);
if (iommu_group_device_count(group) != 1) {
/* Don't break detach if iommu shared by more than one master */
if (iommu_group_device_count(group) < 1) {
WARN_ON(1);
goto out_unlock;
}