lkml.org 
[lkml]   [2023]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 02/10] iommu: Introduce a new iommu_group_replace_domain() API
Date
> From: Nicolin Chen <nicolinc@nvidia.com>
> Sent: Wednesday, February 8, 2023 5:18 AM
>
> +int iommu_group_replace_domain(struct iommu_group *group,
> + struct iommu_domain *new_domain)
> +{
> + int ret;
> +
> + if (!new_domain)
> + return -EINVAL;

Is there value of allowing NULL new domain so this plays like
iommu_detach_group() then iommufd only needs call one
function in both attach/detach path?

> +
> + mutex_lock(&group->mutex);
> + ret = __iommu_group_set_domain(group, new_domain);
> + if (ret)
> + __iommu_group_set_domain(group, group->domain);
> + mutex_unlock(&group->mutex);
> + return ret;
> +}
> +EXPORT_SYMBOL_NS_GPL(iommu_group_replace_domain,
> IOMMUFD_INTERNAL);
> +
> static int iommu_group_do_set_platform_dma(struct device *dev, void
> *data)
> {
> const struct iommu_ops *ops = dev_iommu_ops(dev);
> --
> 2.39.1
>

\
 
 \ /
  Last update: 2023-03-27 00:15    [W:0.334 / U:1.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site