|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [RFC v2 2/2] arm,smmu: add support for generic DT bindings
Hi Brian, On 22/07/2020 05:00, Brian Woods wrote: Restructure some of the code and add supporting functions for addinggeneric device tree (DT) binding support. It feels to me you want to split the patch in two: 1) Restructure the code 2) Add support for DT bindings This will allow for using current Linux device trees with just modifying the chosen field to enable Xen. So what happen if the legacy binding and generic bindings co-exist. Which one will be used? Signed-off-by: Brian Woods <brian.woods@xxxxxxxxxx> --- Just realized that I'm fairly sure I need to do some work on the SMRs. Other than that though, I think things should be okayish. The SMMU code in Xen is pretty awful (I know I adapted it for Xen). It would be hard to make it worse :).
Please don't use explicit cast to remove a const. If you need find_smmu() to return a non-const value, then you should drop the const from the return function. + if (smmu == NULL) + return -ENXIO; + + return arm_smmu_dt_add_device_legacy(smmu, dev, fwspec); This feels a bit odd to me to call a "legacy" function from a "generic" call. How about remove "legacy" from the function name? +} + +static int arm_smmu_dt_xlate_generic(struct device *dev, + const struct of_phandle_args *spec) Please use dt_phandle_args to stay consistent with the naming and the fact the code is mostly Xen specific (though derived from Linux).
-static __init const struct arm_smmu_device *find_smmu(const struct device *dev)
I would add a comment in the commit message explaining the hack in iommu_add_dt_device() can be removed. + return -EINVAL;if ( !dt_device_is_available(iommu_spec.np) ) Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |