Linux IOMMU Development
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Will Deacon <will.deacon@arm.com>
Cc: Rob Clark <robdclark@gmail.com>,
	iommu@lists.linux-foundation.org, linux-arm-msm@vger.kernel.org,
	Sricharan R <sricharan@codeaurora.org>,
	Jordan Crouse <jcrouse@codeaurora.org>,
	robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [RFC 1/3] iommu/arm-smmu: Add support to opt-in to stalling
Date: Thu, 5 Jan 2017 12:08:57 +0000	[thread overview]
Message-ID: <20170105120857.GB21952@leverpostej> (raw)
In-Reply-To: <20170105115528.GG679@arm.com>

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:
> > TODO maybe we want two options, one to enable stalling, and 2nd to punt
> > handling to wq?  I haven't needed to use mm APIs from fault handler yet
> > (although it is something that I think we'll want some day).  Perhaps
> > stalling support is limited to just letting driver dump some extra
> > debugging information otherwise.  Threaded handling probably only useful
> > with stalling, but inverse may not always be true.
> 
> I'd actually like to see this stuck on a worker thread, because I think
> that's more generally useful and I don't want to have a situation where
> sometimes the IOMMU fault notifier is run in IRQ context and sometimes it's
> not.
> 
> > 
> > Signed-off-by: Rob Clark <robdclark@gmail.com>
> > ---
> >  .../devicetree/bindings/iommu/arm,smmu.txt         |  3 ++
> >  drivers/iommu/arm-smmu.c                           | 42 ++++++++++++++++++----
> >  2 files changed, 39 insertions(+), 6 deletions(-)
> > 
> > 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?

> >  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?

Thanks,
Mark.

  reply	other threads:[~2017-01-05 12:08 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 21:30 [RFC 0/3] iommu/arm-smmu: patches for adreno Rob Clark
     [not found] ` <1483479056-15202-1-git-send-email-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-03 21:30   ` [RFC 1/3] iommu/arm-smmu: Add support to opt-in to stalling Rob Clark
     [not found]     ` <1483479056-15202-2-git-send-email-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-05 11:55       ` Will Deacon
2017-01-05 12:08         ` Mark Rutland [this message]
2017-01-05 14:00           ` Will Deacon
     [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
2017-01-03 21:30   ` [RFC 2/3] iommu/arm-smmu: Add qcom implementation Rob Clark
     [not found]     ` <1483479056-15202-3-git-send-email-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-03 22:28       ` Jordan Crouse
     [not found]         ` <20170103222832.GA19199-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
2017-01-04 13:33           ` Sricharan
2017-01-04 14:31             ` Rob Clark
     [not found]               ` <CAF6AEGuT_qq-UJK3sdvtVqxfsLBH-_jZVKz1vF383tOYVQpraw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-04 17:16                 ` Rob Clark
2017-01-03 21:30   ` [RFC 3/3] iommu/arm-smmu: Let fault handler return -EFAULT 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=20170105120857.GB21952@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jcrouse@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=robh@kernel.org \
    --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