Hi,

On Tuesday 03 June 2014 13:57:38 Khiem Nguyen wrote:
> Hi Laurent,
> 
> Thanks for the patch.
> 
> > +   if (!iommu_present(&platform_bus_type))
> > +           bus_set_iommu(&platform_bus_type, &ipmmu_ops);
> 
> With this code, if error occurs, it's hidden.
> 
> I think it should be like below,
> 
> > +   ret = bus_set_iommu(&platform_bus_type, &ipmmu_ops);
> > +   if (ret < 0)
> > +           return ret;
> 
> In this case, if error occurs, -EBUSY is returned.
> It's easier for troubleshooting the issue.
> 
> How do you think ?

I agree that we have a problem, but the problem is broader than this. Only one 
IOMMU type can be associated with a given bus, so things will break as soon as 
we will compile multiple IOMMU drivers in a multiplatform kernel. I'd like to 
fix this properly, but it requires IOMMU framework changes, and thus time. In 
the meantime we could apply your proposed modification, but it needs an 
additional platform_driver_unregister() call in the bus_set_iommu() error 
path.

-- 
Regards,

Laurent Pinchart

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to