lkml.org 
[lkml]   [2022]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH -next] iommu: return early when devices in a group require different domain type
From
Yuan,

在 2022/8/16 10:07, Yuan Can 写道:
> When alloc default domain for an iommu_group in
> probe_alloc_default_domain, the expected domain
> type of each device in the iommu_group is checked
> in a loop, if two devices require different types,
> the loop can be breaked since the default domain
s/breaked/broken
> will be set to iommu_def_domain_type.
> Return 1 when this happened to break the loop in
> __iommu_group_for_each_dev.
>
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---
> drivers/iommu/iommu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 74bc9111c7be..0d4d78946d31 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -1653,6 +1653,7 @@ static int probe_get_default_domain_type(struct device *dev, void *data)
> dev_name(gtype->dev),
> iommu_domain_type_str(gtype->type));
> gtype->type = 0;
> + return 1; /* end the outer loop */
> }
>
> if (!gtype->dev) {

Thanks,

Ethan

--
"firm, enduring, strong, and long-lived"

\
 
 \ /
  Last update: 2022-08-17 04:07    [W:0.123 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site