Re: [Xen-devel] [PATCH V2 4/6] iommu/arm: Add lightweight iommu_fwspec support

2019-08-13 Thread Oleksandr
On 13.08.19 16:40, Julien Grall wrote: Hi Oleksandr, Hi Julien. One more comment :). On 8/2/19 5:39 PM, Oleksandr Tyshchenko wrote: +int iommu_fwspec_init(struct device *dev, struct device *iommu_dev) +{ +    struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); + +    if ( fwspec )

Re: [Xen-devel] [PATCH V2 4/6] iommu/arm: Add lightweight iommu_fwspec support

2019-08-13 Thread Oleksandr
On 13.08.19 18:28, Julien Grall wrote: Hi, Hi Julien On 8/13/19 4:17 PM, Oleksandr wrote: On 13.08.19 15:39, Julien Grall wrote: xfree is able to deal with NULL pointer, so the check is not necessary. Yes, the reason I left this check is to not perform an extra operation (dev_iommu_

Re: [Xen-devel] [PATCH V2 4/6] iommu/arm: Add lightweight iommu_fwspec support

2019-08-13 Thread Julien Grall
Hi, On 8/13/19 4:17 PM, Oleksandr wrote: On 13.08.19 15:39, Julien Grall wrote: xfree is able to deal with NULL pointer, so the check is not necessary. Yes, the reason I left this check is to not perform an extra operation (dev_iommu_fwspec_set). Shall I drop this check anyway? I can't s

Re: [Xen-devel] [PATCH V2 4/6] iommu/arm: Add lightweight iommu_fwspec support

2019-08-13 Thread Oleksandr
On 13.08.19 15:39, Julien Grall wrote: Hi Oleksandr, Hi Julien. On 8/2/19 5:39 PM, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko We need to have some abstract way to add new device to the IOMMU based on the generic IOMMU DT binding [1] which can be used for both DT (right now)

Re: [Xen-devel] [PATCH V2 4/6] iommu/arm: Add lightweight iommu_fwspec support

2019-08-13 Thread Julien Grall
Hi Oleksandr, One more comment :). On 8/2/19 5:39 PM, Oleksandr Tyshchenko wrote: +int iommu_fwspec_init(struct device *dev, struct device *iommu_dev) +{ +struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); + +if ( fwspec ) I would actually check the iommu_dev passed in parameter

Re: [Xen-devel] [PATCH V2 4/6] iommu/arm: Add lightweight iommu_fwspec support

2019-08-13 Thread Julien Grall
Hi Oleksandr, On 8/2/19 5:39 PM, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko We need to have some abstract way to add new device to the IOMMU based on the generic IOMMU DT binding [1] which can be used for both DT (right now) and ACPI (in future). For that reason we can borrow the

[Xen-devel] [PATCH V2 4/6] iommu/arm: Add lightweight iommu_fwspec support

2019-08-02 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko We need to have some abstract way to add new device to the IOMMU based on the generic IOMMU DT binding [1] which can be used for both DT (right now) and ACPI (in future). For that reason we can borrow the idea used in Linux these days called "iommu_fwspec". Having this