From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Vivek Gautam <vivek.gautam@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org, joro@8bytes.org,
will.deacon@arm.com, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, robin.murphy@arm.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/1] iommu/arm-smmu: Log CBFRSYNRA register on context fault
Date: Thu, 18 Apr 2019 17:24:57 -0700 [thread overview]
Message-ID: <20190419002457.GA3137@builder> (raw)
In-Reply-To: <20190415173758.22112-1-vivek.gautam@codeaurora.org>
On Mon 15 Apr 10:37 PDT 2019, Vivek Gautam wrote:
> Bits[15:0] in CBFRSYNRA register contain information about
> StreamID of the incoming transaction that generated the
> fault. Dump CBFRSYNRA register to get this info.
> This is specially useful in a distributed SMMU architecture
> where multiple masters are connected to the SMMU.
> SID information helps to quickly identify the faulting
> master device.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> ---
>
> V1 of the patch available @
> https://lore.kernel.org/patchwork/patch/1061615/
>
> Changes from v1:
> - Dump the raw register value of CBFRSYNRA register in the
> context fault log rather than extracting the SID inforamtion
> and dumping that.
>
> drivers/iommu/arm-smmu-regs.h | 2 ++
> drivers/iommu/arm-smmu.c | 8 ++++++--
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/arm-smmu-regs.h b/drivers/iommu/arm-smmu-regs.h
> index a1226e4ab5f8..e9132a926761 100644
> --- a/drivers/iommu/arm-smmu-regs.h
> +++ b/drivers/iommu/arm-smmu-regs.h
> @@ -147,6 +147,8 @@ enum arm_smmu_s2cr_privcfg {
> #define CBAR_IRPTNDX_SHIFT 24
> #define CBAR_IRPTNDX_MASK 0xff
>
> +#define ARM_SMMU_GR1_CBFRSYNRA(n) (0x400 + ((n) << 2))
> +
> #define ARM_SMMU_GR1_CBA2R(n) (0x800 + ((n) << 2))
> #define CBA2R_RW64_32BIT (0 << 0)
> #define CBA2R_RW64_64BIT (1 << 0)
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 045d93884164..a4773e8c6b0e 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -575,7 +575,9 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
> struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
> struct arm_smmu_cfg *cfg = &smmu_domain->cfg;
> struct arm_smmu_device *smmu = smmu_domain->smmu;
> + void __iomem *gr1_base = ARM_SMMU_GR1(smmu);
> void __iomem *cb_base;
> + u32 cbfrsynra;
>
> cb_base = ARM_SMMU_CB(smmu, cfg->cbndx);
> fsr = readl_relaxed(cb_base + ARM_SMMU_CB_FSR);
> @@ -585,10 +587,12 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
>
> fsynr = readl_relaxed(cb_base + ARM_SMMU_CB_FSYNR0);
> iova = readq_relaxed(cb_base + ARM_SMMU_CB_FAR);
> + cbfrsynra = readl_relaxed(gr1_base +
> + ARM_SMMU_GR1_CBFRSYNRA(cfg->cbndx));
The 80 char limit is more like a guideline anyways...please don't wrap
this.
>
> dev_err_ratelimited(smmu->dev,
> - "Unhandled context fault: fsr=0x%x, iova=0x%08lx, fsynr=0x%x, cb=%d\n",
> - fsr, iova, fsynr, cfg->cbndx);
> + "Unhandled context fault: fsr=0x%x, iova=0x%08lx, fsynr=0x%x, cbfrsynra = 0x%x, cb=%d\n",
Drop the spaces around '='.
With those addressed, you have my
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Regards,
Bjorn
> + fsr, iova, fsynr, cbfrsynra, cfg->cbndx);
>
> writel(fsr, cb_base + ARM_SMMU_CB_FSR);
> return IRQ_HANDLED;
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-04-19 0:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-15 8:07 [PATCH 1/1] iommu/arm-smmu: Add SID information to context fault log Vivek Gautam
2019-04-15 8:54 ` Marc Gonzalez
2019-04-15 12:04 ` Vivek Gautam
2019-04-15 9:41 ` Robin Murphy
2019-04-15 12:05 ` Vivek Gautam
2019-04-15 17:37 ` [PATCH 1/1] iommu/arm-smmu: Log CBFRSYNRA register on context fault Vivek Gautam
2019-04-19 0:24 ` Bjorn Andersson [this message]
2019-04-19 5:34 ` Vivek Gautam
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=20190419002457.GA3137@builder \
--to=bjorn.andersson@linaro.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=vivek.gautam@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;
as well as URLs for NNTP newsgroup(s).