Linux IOMMU Development
 help / color / mirror / Atom feed
From: Andreas Herrmann <andreas.herrmann-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
To: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Cc: "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH 7/7] iommu/arm-smmu: Clear global and context bank fault status and syndrome registers
Date: Wed, 25 Sep 2013 20:20:03 +0200	[thread overview]
Message-ID: <20130925182003.GD4845@alberich> (raw)
In-Reply-To: <20130925164917.GG14502-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>

On Wed, Sep 25, 2013 at 12:49:18PM -0400, Will Deacon wrote:
> On Tue, Sep 24, 2013 at 07:32:47PM +0100, Andreas Herrmann wrote:
> > On Tue, Sep 24, 2013 at 11:42:52AM -0400, Will Deacon wrote:
> > > On Tue, Sep 24, 2013 at 04:07:01PM +0100, Andreas Herrmann wrote:
> > > > Signed-off-by: Andreas Herrmann <andreas.herrmann-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
> > > > ---
> > > >  drivers/iommu/arm-smmu.c |    9 +++++++++
> > > >  1 file changed, 9 insertions(+)
> > > > 
> > > > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> > > > index 251564e..a499146 100644
> > > > --- a/drivers/iommu/arm-smmu.c
> > > > +++ b/drivers/iommu/arm-smmu.c
> > > > @@ -645,6 +645,10 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain)
> > > >  	stage1 = root_cfg->cbar != CBAR_TYPE_S2_TRANS;
> > > >  	cb_base = ARM_SMMU_CB_BASE(smmu) + ARM_SMMU_CB(smmu, root_cfg->cbndx);
> > > >  
> > > > +	/* clear fsr */
> > > > +	writel_relaxed(0xffffffff, cb_base + ARM_SMMU_CB_FSR);
> > > > +	writel_relaxed(0, cb_base + ARM_SMMU_CB_FSYNR0);
> > > > +
> > > >  	/* CBAR */
> > > >  	reg = root_cfg->cbar;
> > > >  	if (smmu->version == 1)
> > > > @@ -1570,6 +1574,11 @@ static void arm_smmu_device_reset(struct arm_smmu_device *smmu)
> > > >  	int i = 0;
> > > >  	u32 scr0 = readl_relaxed(gr0_base + ARM_SMMU_GR0_sCR0);
> > > >  
> > > > +	/* clear global FSRs */
> > > > +	writel(0xffffffff, gr0_base + ARM_SMMU_GR0_sGFSR);
> > > > +	writel(0, gr0_base + ARM_SMMU_GR0_sGFSYNR0);
> > > > +	writel(0, gr0_base + ARM_SMMU_GR0_sGFSYNR1);
> > > 
> > > Why do you need this?
> > 
> > According to the spec the status and syndrome registers have
> > unknown/unpredictable reset values. So better set known values before
> > we start to use these registers (ie. handle faults where we read
> > them). No?
> 
> Sure, but the only time these are made visible should be if we take a fault,
> in which case the registers should contain something meaningful. I guess I
> could see a problem if there is a shared interrupt line for faults though,
> so a cut-down version of your patch (just clearing ARM_SMMU_GR0_sGFSR and
> the ARM_SMMU_CB_FSR registers) should be enough.

Agreed.

Andreas

  parent reply	other threads:[~2013-09-25 18:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 15:06 [PATCH 0/7]: iommu/arm-smmu: Misc fixes/adaptions Andreas Herrmann
2013-09-24 15:06 ` [PATCH 1/7] iommu/arm-smmu: Switch to arch_initcall for driver registration Andreas Herrmann
2013-09-24 15:14   ` Andreas Herrmann
2013-09-24 15:19     ` Will Deacon
2013-09-24 15:06 ` [PATCH 2/7] iommu/arm-smmu: Calculate SMMU_CB_BASE from smmu register values Andreas Herrmann
2013-09-24 15:34   ` Will Deacon
     [not found]     ` <20130924153457.GC20774-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
2013-09-24 18:07       ` Andreas Herrmann
2013-09-25 16:43         ` Will Deacon
2013-09-24 15:06 ` [PATCH 3/7] ARM: dma-mapping: Always pass proper prot flags to iommu_map() Andreas Herrmann
     [not found]   ` <1380035221-11576-4-git-send-email-andreas.herrmann-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
2013-09-24 15:36     ` Will Deacon
     [not found]       ` <20130924153625.GD20774-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
2013-09-24 17:40         ` Andreas Herrmann
2013-09-24 15:06 ` [PATCH 4/7] iommu/arm-smmu: Check for num_context_irqs > 0 to avoid divide by zero exception Andreas Herrmann
     [not found]   ` <1380035221-11576-5-git-send-email-andreas.herrmann-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
2013-09-24 15:40     ` Will Deacon
     [not found]       ` <20130924154048.GE20774-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
2013-09-25 10:50         ` Andreas Herrmann
2013-09-24 15:06 ` [PATCH 5/7] iommu/arm-smmu: Add function that isolates all masters for all SMMUs Andreas Herrmann
2013-09-24 15:07 ` [PATCH 6/7] iommu/arm-smmu: Add module parameter arm-smmu=off|force_isolation Andreas Herrmann
     [not found]   ` <1380035221-11576-7-git-send-email-andreas.herrmann-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
2013-09-24 15:42     ` Will Deacon
     [not found]       ` <20130924154218.GF20774-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
2013-09-25 14:56         ` Andreas Herrmann
2013-09-25 15:57         ` Joerg Roedel
2013-09-24 15:07 ` [PATCH 7/7] iommu/arm-smmu: Clear global and context bank fault status and syndrome registers Andreas Herrmann
     [not found]   ` <1380035221-11576-8-git-send-email-andreas.herrmann-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
2013-09-24 15:42     ` Will Deacon
     [not found]       ` <20130924154252.GG20774-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
2013-09-24 18:32         ` Andreas Herrmann
2013-09-25 16:49           ` Will Deacon
     [not found]             ` <20130925164917.GG14502-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
2013-09-25 18:20               ` Andreas Herrmann [this message]
2013-09-24 15:31 ` [PATCH 0/7]: iommu/arm-smmu: Misc fixes/adaptions Will Deacon

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=20130925182003.GD4845@alberich \
    --to=andreas.herrmann-bsgfqqb8/dxbdgjk7y7tuq@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@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