From: Joerg Roedel <joro@8bytes.org>
To: iommu@lists.linux-foundation.org
Cc: Russell King <linux@armlinux.org.uk>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Tony Luck <tony.luck@intel.com>,
Fenghua Yu <fenghua.yu@intel.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
x86@kernel.org, Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Joerg Roedel <joro@8bytes.org>,
David Woodhouse <dwmw2@infradead.org>,
Lu Baolu <baolu.lu@linux.intel.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Heiko Stuebner <heiko@sntech.de>,
Thierry Reding <thierry.reding@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, intel-gfx@lists.freedesktop.org,
Joerg Roedel <jroedel@suse.de>
Subject: [PATCH 06/13] iommu/tegra: Use dev_iommu_priv_get/set()
Date: Thu, 25 Jun 2020 15:08:29 +0200 [thread overview]
Message-ID: <20200625130836.1916-7-joro@8bytes.org> (raw)
In-Reply-To: <20200625130836.1916-1-joro@8bytes.org>
From: Joerg Roedel <jroedel@suse.de>
Remove the use of dev->archdata.iommu and use the private per-device
pointer provided by IOMMU core code instead.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/tegra-gart.c | 8 ++++----
drivers/iommu/tegra-smmu.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index 5fbdff6ff41a..fac720273889 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -113,8 +113,8 @@ static int gart_iommu_attach_dev(struct iommu_domain *domain,
if (gart->active_domain && gart->active_domain != domain) {
ret = -EBUSY;
- } else if (dev->archdata.iommu != domain) {
- dev->archdata.iommu = domain;
+ } else if (dev_iommu_priv_get(dev) != domain) {
+ dev_iommu_priv_set(dev, domain);
gart->active_domain = domain;
gart->active_devices++;
}
@@ -131,8 +131,8 @@ static void gart_iommu_detach_dev(struct iommu_domain *domain,
spin_lock(&gart->dom_lock);
- if (dev->archdata.iommu == domain) {
- dev->archdata.iommu = NULL;
+ if (dev_iommu_priv_get(dev) == domain) {
+ dev_iommu_priv_set(dev, NULL);
if (--gart->active_devices == 0)
gart->active_domain = NULL;
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 7426b7666e2b..124c8848ab7e 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -465,7 +465,7 @@ static void tegra_smmu_as_unprepare(struct tegra_smmu *smmu,
static int tegra_smmu_attach_dev(struct iommu_domain *domain,
struct device *dev)
{
- struct tegra_smmu *smmu = dev->archdata.iommu;
+ struct tegra_smmu *smmu = dev_iommu_priv_get(dev);
struct tegra_smmu_as *as = to_smmu_as(domain);
struct device_node *np = dev->of_node;
struct of_phandle_args args;
@@ -780,7 +780,7 @@ static struct iommu_device *tegra_smmu_probe_device(struct device *dev)
* supported by the Linux kernel, so abort after the
* first match.
*/
- dev->archdata.iommu = smmu;
+ dev_iommu_priv_set(dev, smmu);
break;
}
@@ -797,7 +797,7 @@ static struct iommu_device *tegra_smmu_probe_device(struct device *dev)
static void tegra_smmu_release_device(struct device *dev)
{
- dev->archdata.iommu = NULL;
+ dev_iommu_priv_set(dev, NULL);
}
static const struct tegra_smmu_group_soc *
@@ -856,7 +856,7 @@ static struct iommu_group *tegra_smmu_group_get(struct tegra_smmu *smmu,
static struct iommu_group *tegra_smmu_device_group(struct device *dev)
{
struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
- struct tegra_smmu *smmu = dev->archdata.iommu;
+ struct tegra_smmu *smmu = dev_iommu_priv_get(dev);
struct iommu_group *group;
group = tegra_smmu_group_get(smmu, fwspec->ids[0]);
--
2.27.0
next prev parent reply other threads:[~2020-06-25 13:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 13:08 [PATCH 00/13] iommu: Remove usage of dev->archdata.iommu Joerg Roedel
2020-06-25 13:08 ` [PATCH 01/13] iommu/exynos: Use dev_iommu_priv_get/set() Joerg Roedel
2020-06-29 7:51 ` Marek Szyprowski
2020-06-25 13:08 ` [PATCH 02/13] iommu/vt-d: " Joerg Roedel
2020-06-25 13:24 ` Lu Baolu
2020-06-25 13:08 ` [PATCH 03/13] iommu/msm: " Joerg Roedel
2020-06-25 13:08 ` [PATCH 04/13] iommu/omap: " Joerg Roedel
2020-06-25 13:08 ` [PATCH 05/13] iommu/rockchip: " Joerg Roedel
2020-06-25 13:08 ` Joerg Roedel [this message]
2020-06-25 13:08 ` [PATCH 07/13] iommu/pamu: " Joerg Roedel
2020-06-25 13:08 ` [PATCH 08/13] iommu/mediatek: Do no use dev->archdata.iommu Joerg Roedel
2020-06-25 13:08 ` [PATCH 09/13] x86: Remove dev->archdata.iommu pointer Joerg Roedel
2020-06-26 11:46 ` Borislav Petkov
2020-06-25 13:08 ` [PATCH 10/13] ia64: " Joerg Roedel
2020-06-25 13:08 ` [PATCH 11/13] arm: " Joerg Roedel
2020-06-25 13:08 ` [PATCH 12/13] arm64: " Joerg Roedel
2020-06-25 13:16 ` Will Deacon
2020-06-25 13:08 ` [PATCH 13/13] powerpc/dma: Remove dev->archdata.iommu_domain Joerg Roedel
2020-06-29 10:57 ` Michael Ellerman
2020-06-26 1:41 ` [PATCH 00/13] iommu: Remove usage of dev->archdata.iommu Jerry Snitselaar
2020-06-30 10:00 ` Joerg Roedel
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=20200625130836.1916-7-joro@8bytes.org \
--to=joro@8bytes.org \
--cc=airlied@linux.ie \
--cc=baolu.lu@linux.intel.com \
--cc=benh@kernel.crashing.org \
--cc=catalin.marinas@arm.com \
--cc=daniel@ffwll.ch \
--cc=dwmw2@infradead.org \
--cc=fenghua.yu@intel.com \
--cc=heiko@sntech.de \
--cc=intel-gfx@lists.freedesktop.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=jroedel@suse.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=m.szyprowski@samsung.com \
--cc=matthias.bgg@gmail.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=rodrigo.vivi@intel.com \
--cc=thierry.reding@gmail.com \
--cc=tony.luck@intel.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).