From ee886e22c69048440c4d80c6030189808597aca1 Mon Sep 17 00:00:00 2001 From: Simon Xue Date: Tue, 8 Sep 2020 16:05:54 +0800 Subject: [PATCH] iommu: don't break detach if iommu shared by more than one master Change-Id: I4fade6e770e124dcaca41d122965e8696f268556 Signed-off-by: Simon Xue --- drivers/iommu/iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 0a03379c16e9..4e0c8a9f8600 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2196,7 +2196,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; }