From: "Roedel, Joerg" <Joerg.Roedel@amd.com>
To: KyongHo Cho <pullip.cho@samsung.com>
Cc: 'Linux ARM Kernel' <linux-arm-kernel@lists.infradead.org>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
'Russell King' <rmk+kernel@arm.linux.org.uk>,
'Ohad Ben-Cohen' <ohad@wizery.com>,
'Sanghyun Lee' <sanghyun75.lee@samsung.com>,
"younglak1004.kim@samsung.com" <younglak1004.kim@samsung.com>,
'Kukjin Kim' <kgene.kim@samsung.com>
Subject: Re: [PATCH v5 2/2] iommu/exynos: Add iommu driver for Exynos Platforms
Date: Fri, 14 Oct 2011 16:17:14 +0200 [thread overview]
Message-ID: <20111014141714.GD2198@amd.com> (raw)
In-Reply-To: <000501cc897f$fa0204f0$ee060ed0$%cho@samsung.com>
On Thu, Oct 13, 2011 at 04:13:23AM -0400, KyongHo Cho wrote:
> +struct exynos_iommu_domain {
> + struct device *dev;
> + unsigned long *pgtable;
> + spinlock_t lock;
> + spinlock_t pgtablelock;
> +};
Can you please add comments to document what these spinlocks protect?
> +static int exynos_iommu_attach_device(struct iommu_domain *domain,
> + struct device *dev)
> +{
> + struct exynos_iommu_domain *priv = domain->priv;
> + int ret;
> +
> + spin_lock(&priv->lock);
> +
> + priv->dev = dev;
> +
> + spin_unlock(&priv->lock);
> +
> + ret = exynos_iommu_enable(domain);
> +
> + return ret;
> +}
> +
> +static void exynos_iommu_detach_device(struct iommu_domain *domain,
> + struct device *dev)
> +{
> + struct exynos_iommu_domain *priv = domain->priv;
> +
> + spin_lock(&priv->lock);
> +
> + if (priv->dev == dev) {
> + priv->dev = NULL;
> +
> + spin_unlock(&priv->lock);
> +
> + exynos_iommu_disable(domain);
> + } else {
> + spin_unlock(&priv->lock);
> + }
> +}
That looks weird. As I read this code there is a 1-1 mapping between a
device and a domain. This breaks semantics of the iommu-api where a
domain can contain multiple devices.
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
WARNING: multiple messages have this Message-ID (diff)
From: Joerg.Roedel@amd.com (Roedel, Joerg)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/2] iommu/exynos: Add iommu driver for Exynos Platforms
Date: Fri, 14 Oct 2011 16:17:14 +0200 [thread overview]
Message-ID: <20111014141714.GD2198@amd.com> (raw)
In-Reply-To: <000501cc897f$fa0204f0$ee060ed0$%cho@samsung.com>
On Thu, Oct 13, 2011 at 04:13:23AM -0400, KyongHo Cho wrote:
> +struct exynos_iommu_domain {
> + struct device *dev;
> + unsigned long *pgtable;
> + spinlock_t lock;
> + spinlock_t pgtablelock;
> +};
Can you please add comments to document what these spinlocks protect?
> +static int exynos_iommu_attach_device(struct iommu_domain *domain,
> + struct device *dev)
> +{
> + struct exynos_iommu_domain *priv = domain->priv;
> + int ret;
> +
> + spin_lock(&priv->lock);
> +
> + priv->dev = dev;
> +
> + spin_unlock(&priv->lock);
> +
> + ret = exynos_iommu_enable(domain);
> +
> + return ret;
> +}
> +
> +static void exynos_iommu_detach_device(struct iommu_domain *domain,
> + struct device *dev)
> +{
> + struct exynos_iommu_domain *priv = domain->priv;
> +
> + spin_lock(&priv->lock);
> +
> + if (priv->dev == dev) {
> + priv->dev = NULL;
> +
> + spin_unlock(&priv->lock);
> +
> + exynos_iommu_disable(domain);
> + } else {
> + spin_unlock(&priv->lock);
> + }
> +}
That looks weird. As I read this code there is a 1-1 mapping between a
device and a domain. This breaks semantics of the iommu-api where a
domain can contain multiple devices.
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
next prev parent reply other threads:[~2011-10-14 14:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 8:13 [PATCH v5 2/2] iommu/exynos: Add iommu driver for Exynos Platforms KyongHo Cho
2011-10-13 8:13 ` KyongHo Cho
2011-10-14 14:17 ` Roedel, Joerg [this message]
2011-10-14 14:17 ` Roedel, Joerg
2011-10-15 1:55 ` KyongHo Cho
2011-10-15 1:55 ` KyongHo Cho
-- strict thread matches above, loose matches on Subject: below --
2011-10-12 9:25 KyongHo Cho
2011-10-12 9:25 ` KyongHo Cho
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=20111014141714.GD2198@amd.com \
--to=joerg.roedel@amd.com \
--cc=iommu@lists.linux-foundation.org \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=ohad@wizery.com \
--cc=pullip.cho@samsung.com \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=sanghyun75.lee@samsung.com \
--cc=younglak1004.kim@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.