Good effort to isolate bus config from smmu drivers.
Reviewed-By: Krishna Reddy <[email protected]>

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
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to