From: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
To: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH] iommu/of: Only do IOMMU lookup for available ones
Date: Thu, 18 Jan 2018 14:41:18 +0000 [thread overview]
Message-ID: <20180118144118.GA12394@arm.com> (raw)
In-Reply-To: <20180117132808.s5henw63oseg3ufd-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
On Wed, Jan 17, 2018 at 02:28:08PM +0100, Joerg Roedel wrote:
> On Wed, Jan 03, 2018 at 02:09:20PM +0800, Jeffy Chen wrote:
> > The for_each_matching_node_and_match() would return every matching
> > nodes including unavailable ones.
> >
> > It's pointless to init unavailable IOMMUs, so add a sanity check to
> > avoid that.
> >
> > Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> > ---
> >
> > drivers/iommu/of_iommu.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
> > index 50947ebb6d17..6f7456caa30d 100644
> > --- a/drivers/iommu/of_iommu.c
> > +++ b/drivers/iommu/of_iommu.c
> > @@ -240,6 +240,9 @@ static int __init of_iommu_init(void)
> > for_each_matching_node_and_match(np, matches, &match) {
> > const of_iommu_init_fn init_fn = match->data;
> >
> > + if (!of_device_is_available(np))
> > + continue;
> > +
>
> Makes sense to me, but I'd like to have an OK from Robin or Will (added
> to Cc) before applying this.
I don't think this patch makes a lot of sense in isolation: the SMMU drivers
themselves will likely still probe, and it's unclear what we should about
DMA when an IOMMU is not deemed to be available. See:
https://patchwork.kernel.org/patch/9681211/
Jeffy -- are you solving a real issue here, or is this just an attempt at
some cleanup?
Will
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>,
linux-kernel@vger.kernel.org, jcliang@chromium.org,
tfiga@chromium.org, iommu@lists.linux-foundation.org,
Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH] iommu/of: Only do IOMMU lookup for available ones
Date: Thu, 18 Jan 2018 14:41:18 +0000 [thread overview]
Message-ID: <20180118144118.GA12394@arm.com> (raw)
In-Reply-To: <20180117132808.s5henw63oseg3ufd@8bytes.org>
On Wed, Jan 17, 2018 at 02:28:08PM +0100, Joerg Roedel wrote:
> On Wed, Jan 03, 2018 at 02:09:20PM +0800, Jeffy Chen wrote:
> > The for_each_matching_node_and_match() would return every matching
> > nodes including unavailable ones.
> >
> > It's pointless to init unavailable IOMMUs, so add a sanity check to
> > avoid that.
> >
> > Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> > ---
> >
> > drivers/iommu/of_iommu.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
> > index 50947ebb6d17..6f7456caa30d 100644
> > --- a/drivers/iommu/of_iommu.c
> > +++ b/drivers/iommu/of_iommu.c
> > @@ -240,6 +240,9 @@ static int __init of_iommu_init(void)
> > for_each_matching_node_and_match(np, matches, &match) {
> > const of_iommu_init_fn init_fn = match->data;
> >
> > + if (!of_device_is_available(np))
> > + continue;
> > +
>
> Makes sense to me, but I'd like to have an OK from Robin or Will (added
> to Cc) before applying this.
I don't think this patch makes a lot of sense in isolation: the SMMU drivers
themselves will likely still probe, and it's unclear what we should about
DMA when an IOMMU is not deemed to be available. See:
https://patchwork.kernel.org/patch/9681211/
Jeffy -- are you solving a real issue here, or is this just an attempt at
some cleanup?
Will
next prev parent reply other threads:[~2018-01-18 14:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 6:09 [PATCH] iommu/of: Only do IOMMU lookup for available ones Jeffy Chen
[not found] ` <20180103060920.23475-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2018-01-08 11:45 ` Robin Murphy
2018-01-08 11:45 ` Robin Murphy
2018-01-17 13:28 ` Joerg Roedel
[not found] ` <20180117132808.s5henw63oseg3ufd-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2018-01-18 14:41 ` Will Deacon [this message]
2018-01-18 14:41 ` Will Deacon
[not found] ` <20180118144118.GA12394-5wv7dgnIgG8@public.gmane.org>
2018-01-18 14:58 ` JeffyChen
2018-01-18 14:58 ` JeffyChen
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=20180118144118.GA12394@arm.com \
--to=will.deacon-5wv7dgnigg8@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jcliang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 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.