lkml.org 
[lkml]   [2022]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 02/13] iommu: Move bus setup to IOMMU device registration
Date
Good effort to isolate bus config from smmu drivers.
Reviewed-By: Krishna Reddy <vdumpa@nvidia.com>

I have an orthogonal question here.
Can the following code handle the case, where different buses have different type of SMMU instances(like one bus has SMMUv2 and another bus has SMMUv3)?
If it need to handle the above case, can the smmu device bus be matched with specific bus here and ops set only for that bus?


> + for (int i = 0; i < ARRAY_SIZE(iommu_buses); i++) {
> + struct bus_type *bus = iommu_buses[i];
> + const struct iommu_ops *bus_ops = bus->iommu_ops;
> + int err;
> +
> + WARN_ON(bus_ops && bus_ops != ops);
> + bus->iommu_ops = ops;
> + err = bus_iommu_probe(bus);
> + if (err) {
> + bus_for_each_dev(bus, NULL, iommu,
> remove_iommu_group);
> + bus->iommu_ops = bus_ops;
> + return err;
> + }
> + }


-KR

\
 
 \ /
  Last update: 2022-04-22 21:01    [W:1.059 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site