ommu_domain *io_domain, struct device *dev, struct iommu_domain *old) { @@ -598,11 +622,6 @@ static int ipmmu_attach_device(struct iommu_domain *io_domain, unsigned int i; int ret = 0; - if (!mmu) { - dev_err(dev, "Cannot attach to IPMMU\n"); - return -ENXIO; - } - mutex_lock(&domain->mutex); if (!domain->mmu) { @@ -616,13 +635,7 @@ static int ipmmu_attach_device(struct iommu_domain *io_domain, dev_info(dev, "Using IPMMU context %u\n", domain->context_id); } - } else if (domain->mmu != mmu) { - /* - * Something is wrong, we can't attach two devices using - * different IOMMUs to the same domain. - */ - ret = -EINVAL; - } else + } else /* domain->mmu == mmu */ dev_info(dev, "Reusing IPMMU context %u\n", domain->context_id); mutex_unlock(&domain->mutex); @@ -885,6 +898,7 @@ static const struct iommu_ops ipmmu_ops = { ? generic_device_group : generic_single_device_group, .of_xlate = ipmmu_of_xlate, .default_domain_ops = &(const struct iommu_domain_ops) { + .test_dev = ipmmu_domain_test_device, .attach_dev = ipmmu_attach_device, .map_pages = ipmmu_map, .unmap_pages = ipmmu_unmap, -- 2.43.0[PATCH v1 11/20] iommu/ipmmu-vmsa: Implement ipmmu_domain_test_deviceNicolin Chen undefined, , undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined”$ƒ(