[PATCH v1 3/6] iommu/exynos-iommu: Set release_domain to exynos_identity_domain

Nicolin Chen posted 6 patches 2 months, 1 week ago
There is a newer version of this series
[PATCH v1 3/6] iommu/exynos-iommu: Set release_domain to exynos_identity_domain
Posted by Nicolin Chen 2 months, 1 week ago
Following a coming core change to pass in the old domain pointer into the
attach_dev op and its callbacks, exynos_iommu_identity_attach() will need
this new argument too, which the release_device op doesn't provide.

Instead, the core provides a release_domain to attach to the device prior
to invoking the release_device callback. Thus, simply use that.

Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
---
 drivers/iommu/exynos-iommu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index b6edd178fe25e..0857519ca7188 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1429,8 +1429,6 @@ static void exynos_iommu_release_device(struct device *dev)
 	struct exynos_iommu_owner *owner = dev_iommu_priv_get(dev);
 	struct sysmmu_drvdata *data;
 
-	WARN_ON(exynos_iommu_identity_attach(&exynos_identity_domain, dev));
-
 	list_for_each_entry(data, &owner->controllers, owner_node)
 		device_link_del(data->link);
 }
@@ -1476,6 +1474,7 @@ static int exynos_iommu_of_xlate(struct device *dev,
 
 static const struct iommu_ops exynos_iommu_ops = {
 	.identity_domain = &exynos_identity_domain,
+	.release_domain = &exynos_identity_domain,
 	.domain_alloc_paging = exynos_iommu_domain_alloc_paging,
 	.device_group = generic_device_group,
 	.probe_device = exynos_iommu_probe_device,
-- 
2.43.0
Re: [PATCH v1 3/6] iommu/exynos-iommu: Set release_domain to exynos_identity_domain
Posted by Jason Gunthorpe 1 month, 4 weeks ago
On Sun, Oct 12, 2025 at 04:57:39PM -0700, Nicolin Chen wrote:
> Following a coming core change to pass in the old domain pointer into the
> attach_dev op and its callbacks, exynos_iommu_identity_attach() will need
> this new argument too, which the release_device op doesn't provide.
> 
> Instead, the core provides a release_domain to attach to the device prior
> to invoking the release_device callback. Thus, simply use that.
> 
> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
> ---
>  drivers/iommu/exynos-iommu.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason
Re: [PATCH v1 3/6] iommu/exynos-iommu: Set release_domain to exynos_identity_domain
Posted by Marek Szyprowski 2 months, 1 week ago
On 13.10.2025 01:57, Nicolin Chen wrote:
> Following a coming core change to pass in the old domain pointer into the
> attach_dev op and its callbacks, exynos_iommu_identity_attach() will need
> this new argument too, which the release_device op doesn't provide.
>
> Instead, the core provides a release_domain to attach to the device prior
> to invoking the release_device callback. Thus, simply use that.
>
> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>   drivers/iommu/exynos-iommu.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index b6edd178fe25e..0857519ca7188 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1429,8 +1429,6 @@ static void exynos_iommu_release_device(struct device *dev)
>   	struct exynos_iommu_owner *owner = dev_iommu_priv_get(dev);
>   	struct sysmmu_drvdata *data;
>   
> -	WARN_ON(exynos_iommu_identity_attach(&exynos_identity_domain, dev));
> -
>   	list_for_each_entry(data, &owner->controllers, owner_node)
>   		device_link_del(data->link);
>   }
> @@ -1476,6 +1474,7 @@ static int exynos_iommu_of_xlate(struct device *dev,
>   
>   static const struct iommu_ops exynos_iommu_ops = {
>   	.identity_domain = &exynos_identity_domain,
> +	.release_domain = &exynos_identity_domain,
>   	.domain_alloc_paging = exynos_iommu_domain_alloc_paging,
>   	.device_group = generic_device_group,
>   	.probe_device = exynos_iommu_probe_device,

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland