Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1577493 > unrolled thread

[PATCH 10/11] iommu/exynos: Make use of iommu_device_register interface

Started byJoerg Roedel <joro@8bytes.org>
First post2017-02-09 12:50 +0100
Last post2017-02-10 15:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 10/11] iommu/exynos: Make use of iommu_device_register interface Joerg Roedel <joro@8bytes.org> - 2017-02-09 12:50 +0100
    Re: [PATCH 10/11] iommu/exynos: Make use of iommu_device_register  interface Marek Szyprowski <m.szyprowski@samsung.com> - 2017-02-10 14:50 +0100
      Re: [PATCH 10/11] iommu/exynos: Make use of iommu_device_register  interface Joerg Roedel <joro@8bytes.org> - 2017-02-10 15:00 +0100

#1577493 — [PATCH 10/11] iommu/exynos: Make use of iommu_device_register interface

FromJoerg Roedel <joro@8bytes.org>
Date2017-02-09 12:50 +0100
Subject[PATCH 10/11] iommu/exynos: Make use of iommu_device_register interface
Message-ID<t8VoB-5CX-5@gated-at.bofh.it>
From: Joerg Roedel <jroedel@suse.de>

Register Exynos IOMMUs to the IOMMU core and make them
visible in sysfs. This patch does not add the links between
IOMMUs and translated devices yet.

Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/exynos-iommu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 57ba0d3..64325d8 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -276,6 +276,8 @@ struct sysmmu_drvdata {
 	struct list_head owner_node;	/* node for owner controllers list */
 	phys_addr_t pgtable;		/* assigned page table structure */
 	unsigned int version;		/* our version */
+
+	struct iommu_device iommu;	/* IOMMU core handle */
 };
 
 static struct exynos_iommu_domain *to_exynos_domain(struct iommu_domain *dom)
@@ -611,6 +613,18 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
 	data->sysmmu = dev;
 	spin_lock_init(&data->lock);
 
+	ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL,
+				     dev_name(data->sysmmu));
+	if (ret)
+		return ret;
+
+	iommu_device_set_ops(&data->iommu, &exynos_iommu_ops);
+	iommu_device_set_fwnode(&data->iommu, &dev->of_node->fwnode);
+
+	ret = iommu_device_register(&data->iommu);
+	if (ret)
+		return ret;
+
 	platform_set_drvdata(pdev, data);
 
 	__sysmmu_get_version(data);
-- 
1.9.1

[toc] | [next] | [standalone]


#1578461 — Re: [PATCH 10/11] iommu/exynos: Make use of iommu_device_register interface

FromMarek Szyprowski <m.szyprowski@samsung.com>
Date2017-02-10 14:50 +0100
SubjectRe: [PATCH 10/11] iommu/exynos: Make use of iommu_device_register interface
Message-ID<t9jKi-41W-9@gated-at.bofh.it>
In reply to#1577493
Hi

On 2017-02-09 12:32, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> Register Exynos IOMMUs to the IOMMU core and make them
> visible in sysfs. This patch does not add the links between
> IOMMUs and translated devices yet.
>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-samsung-soc@vger.kernel.org
> Signed-off-by: Joerg Roedel <jroedel@suse.de>

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

> ---
>   drivers/iommu/exynos-iommu.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 57ba0d3..64325d8 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -276,6 +276,8 @@ struct sysmmu_drvdata {
>   	struct list_head owner_node;	/* node for owner controllers list */
>   	phys_addr_t pgtable;		/* assigned page table structure */
>   	unsigned int version;		/* our version */
> +
> +	struct iommu_device iommu;	/* IOMMU core handle */
>   };
>   
>   static struct exynos_iommu_domain *to_exynos_domain(struct iommu_domain *dom)
> @@ -611,6 +613,18 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
>   	data->sysmmu = dev;
>   	spin_lock_init(&data->lock);
>   
> +	ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL,
> +				     dev_name(data->sysmmu));
> +	if (ret)
> +		return ret;
> +
> +	iommu_device_set_ops(&data->iommu, &exynos_iommu_ops);
> +	iommu_device_set_fwnode(&data->iommu, &dev->of_node->fwnode);
> +
> +	ret = iommu_device_register(&data->iommu);
> +	if (ret)
> +		return ret;
> +
>   	platform_set_drvdata(pdev, data);
>   
>   	__sysmmu_get_version(data);

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

[toc] | [prev] | [next] | [standalone]


#1578467 — Re: [PATCH 10/11] iommu/exynos: Make use of iommu_device_register interface

FromJoerg Roedel <joro@8bytes.org>
Date2017-02-10 15:00 +0100
SubjectRe: [PATCH 10/11] iommu/exynos: Make use of iommu_device_register interface
Message-ID<t9jTY-45O-13@gated-at.bofh.it>
In reply to#1578461
On Fri, Feb 10, 2017 at 02:46:59PM +0100, Marek Szyprowski wrote:
> Hi
> 
> On 2017-02-09 12:32, Joerg Roedel wrote:
> >From: Joerg Roedel <jroedel@suse.de>
> >
> >Register Exynos IOMMUs to the IOMMU core and make them
> >visible in sysfs. This patch does not add the links between
> >IOMMUs and translated devices yet.
> >
> >Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> >Cc: linux-arm-kernel@lists.infradead.org
> >Cc: linux-samsung-soc@vger.kernel.org
> >Signed-off-by: Joerg Roedel <jroedel@suse.de>
> 
> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

Thanks a lot for testing!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web