From: Magnus Damm <magnus.damm@gmail.com>
To: joro@8bytes.org
Cc: laurent.pinchart+renesas@ideasonboard.com,
geert+renesas@glider.be, robin.murphy@arm.com,
will.deacon@arm.com, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org,
iommu@lists.linux-foundation.org, horms+renesas@verge.net.au,
Magnus Damm <magnus.damm@gmail.com>,
sricharan@codeaurora.org, m.szyprowski@samsung.com
Subject: [PATCH 01/04] iommu/ipmmu-vmsa: Use iommu_device_register()/unregister()
Date: Thu, 15 Jun 2017 19:29:16 +0900 [thread overview]
Message-ID: <149752255681.21887.9984138893493295897.sendpatchset@little-apple> (raw)
In-Reply-To: <149752254550.21887.15183665699230243235.sendpatchset@little-apple>
From: Magnus Damm <damm+renesas@opensource.se>
Extend the driver to make use of iommu_device_register()/unregister()
functions together with iommu_device_set_ops() and iommu_set_fwnode().
These used to be part of the earlier posted 64-bit ARM (r8a7795) series but
it turns out that these days they are required on 32-bit ARM as well.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---
drivers/iommu/ipmmu-vmsa.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- 0001/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c 2017-06-15 16:57:21.890607110 +0900
@@ -35,6 +35,7 @@
struct ipmmu_vmsa_device {
struct device *dev;
void __iomem *base;
+ struct iommu_device iommu;
struct list_head list;
unsigned int num_utlbs;
@@ -1054,6 +1055,13 @@ static int ipmmu_probe(struct platform_d
ipmmu_device_reset(mmu);
+ ret = iommu_device_register(&mmu->iommu);
+ if (ret)
+ return ret;
+
+ iommu_device_set_ops(&mmu->iommu, &ipmmu_ops);
+ iommu_device_set_fwnode(&mmu->iommu, &pdev->dev.of_node->fwnode);
+
/*
* We can't create the ARM mapping here as it requires the bus to have
* an IOMMU, which only happens when bus_set_iommu() is called in
@@ -1077,6 +1085,8 @@ static int ipmmu_remove(struct platform_
list_del(&mmu->list);
spin_unlock(&ipmmu_devices_lock);
+ iommu_device_unregister(&mmu->iommu);
+
#if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)
arm_iommu_release_mapping(mmu->mapping);
#endif
next prev parent reply other threads:[~2017-06-15 10:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 10:29 [PATCH 00/04] iommu/ipmmu-vmsa: 32-bit ARM update Magnus Damm
2017-06-15 10:29 ` Magnus Damm [this message]
2017-06-19 16:27 ` [PATCH 01/04] iommu/ipmmu-vmsa: Use iommu_device_register()/unregister() Robin Murphy
2017-06-15 10:29 ` [PATCH 02/04] iommu/ipmmu-vmsa: Consistent ->of_xlate() handling Magnus Damm
2017-06-16 7:16 ` Geert Uytterhoeven
2017-06-15 10:29 ` [PATCH 03/04] iommu/ipmmu-vmsa: Use fwspec on both 32 and 64-bit ARM Magnus Damm
2017-06-15 10:29 ` [PATCH 04/04] iommu/ipmmu-vmsa: Replace local utlb code with fwspec ids Magnus Damm
2017-06-16 7:18 ` Geert Uytterhoeven
2017-06-16 10:10 ` Magnus Damm
2017-06-19 16:23 ` [PATCH 00/04] iommu/ipmmu-vmsa: 32-bit ARM update Robin Murphy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=149752255681.21887.9984138893493295897.sendpatchset@little-apple \
--to=magnus.damm@gmail.com \
--cc=geert+renesas@glider.be \
--cc=horms+renesas@verge.net.au \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=sricharan@codeaurora.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®