From: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
To: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jordan Crouse <jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [RFC 1/3] iommu/arm-smmu: Add support to opt-in to stalling
Date: Thu, 5 Jan 2017 14:00:05 +0000 [thread overview]
Message-ID: <20170105140005.GJ679@arm.com> (raw)
In-Reply-To: <20170105120857.GB21952@leverpostej>
On Thu, Jan 05, 2017 at 12:08:57PM +0000, Mark Rutland wrote:
> On Thu, Jan 05, 2017 at 11:55:29AM +0000, Will Deacon wrote:
> > On Tue, Jan 03, 2017 at 04:30:54PM -0500, Rob Clark wrote:
> > > diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.txt b/Documentation/devicetree/bindings/iommu/arm,smmu.txt
> > > index ef465b0..5f405a6 100644
> > > --- a/Documentation/devicetree/bindings/iommu/arm,smmu.txt
> > > +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.txt
> > > @@ -68,6 +68,9 @@ conditions.
> > > aliases of secure registers have to be used during
> > > SMMU configuration.
> > >
> > > +- arm,smmu-enable-stall : Enable stall mode to stall memory transactions
> > > + and resume after fault is handled
>
> The wording here seems to describe a policy rather than a property.
>
> Can you elaborate on when/why this is required/preferred/valid?
It's not a policy, it's a hardware capability. There are some non-probeable
reasons why stalling mode is unsafe or unusable:
http://lists.infradead.org/pipermail/linux-arm-kernel/2016-December/474530.html
Some of these are specific to the SMMU implementation (e.g. whether or not
the SS bit can remain set without reasserting the IRQ) and some are specific
to the integration (e.g. whether or not stalling an endpoint can deadlock
the SoC). The key point is that, without support from both the
implementation and the integration, stalls are unusable.
> > > static irqreturn_t arm_smmu_global_fault(int irq, void *dev)
> > > @@ -824,6 +852,8 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain,
> > >
> > > /* SCTLR */
> > > reg = SCTLR_CFIE | SCTLR_CFRE | SCTLR_AFE | SCTLR_TRE | SCTLR_M;
> > > + if (smmu->options & ARM_SMMU_OPT_ENABLE_STALL)
> > > + reg |= SCTLR_CFCFG;
> >
> > I wonder if this should also be predicated on the compatible string, so
> > that the "arm,smmu-enable-stall" property is ignored (with a warning) if
> > the compatible string isn't specific enough to identify an implementation
> > with the required SS behaviour? On the other hand, it feels pretty
> > redundant and a single "stalling works" property is all we need.
>
> Can you elaborate on what "stalling works" entails? Is that just the SS
> bit behaviour? are there integration or endpoint-specific things that we
> need to care about?
See above. The "stalling works" property (arm,smmu-enable-stall) would
indicate that both the implementation *and* the integration are such
that stalling is usable for demand paging. I suspect there are endpoints
that can't deal with stalls (e.g. they might timeout and signal a RAS
event), but in that case their respective device drivers should ensure
that any DMA buffers are pinned and/or register a fault handler to
request termination of the faulting transaction.
Will
next prev parent reply other threads:[~2017-01-05 14:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1483479056-15202-1-git-send-email-robdclark@gmail.com>
[not found] ` <1483479056-15202-2-git-send-email-robdclark@gmail.com>
[not found] ` <1483479056-15202-2-git-send-email-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-05 11:55 ` [RFC 1/3] iommu/arm-smmu: Add support to opt-in to stalling Will Deacon
2017-01-05 12:08 ` Mark Rutland
2017-01-05 14:00 ` Will Deacon [this message]
[not found] ` <20170105140005.GJ679-5wv7dgnIgG8@public.gmane.org>
2017-01-05 14:07 ` Mark Rutland
2017-01-05 14:47 ` Will Deacon
[not found] ` <20170105144742.GK679-5wv7dgnIgG8@public.gmane.org>
2017-01-05 15:32 ` Robin Murphy
2017-01-05 16:07 ` Will Deacon
[not found] ` <20170105160755.GN679-5wv7dgnIgG8@public.gmane.org>
2017-01-05 17:03 ` Robin Murphy
[not found] ` <611575f4-3e37-1f4d-ef29-94e6f65baf66-5wv7dgnIgG8@public.gmane.org>
2017-01-05 17:25 ` Will Deacon
2017-01-06 16:36 ` Rob Clark
[not found] ` <20170105115528.GG679-5wv7dgnIgG8@public.gmane.org>
2017-01-05 15:27 ` Rob Clark
[not found] ` <CAF6AEGsUdZALAQTozmxPV8Os=3pG7ay=1Oqtctx99FV9_4SX7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-05 15:49 ` Will Deacon
[not found] ` <20170105154950.GM679-5wv7dgnIgG8@public.gmane.org>
2017-01-06 16:26 ` Rob Clark
2017-01-10 17:52 ` Will Deacon
[not found] ` <20170110175219.GK527-5wv7dgnIgG8@public.gmane.org>
2017-01-10 19:20 ` Rob Clark
[not found] ` <CAF6AEGsCJ6L-wmBHFYy2jfQ1bfq_d2wmiWVUXno344US9ikLVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-11 9:36 ` Will Deacon
[not found] ` <20170111093606.GA12388-5wv7dgnIgG8@public.gmane.org>
2017-01-11 20:59 ` Rob Clark
2017-01-12 15:17 ` Will Deacon
[not found] ` <20170112151717.GB13843-5wv7dgnIgG8@public.gmane.org>
2017-01-30 20:51 ` Rob Clark
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=20170105140005.GJ679@arm.com \
--to=will.deacon-5wv7dgnigg8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@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 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).