Skip to contentSkip to conversation

iommu/arm-smmu: Add SID information to context fault log

PATCH In review Vivek Gautam 4 participants 8 messages Apr 15, 2019 – Apr 19, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/arm-smmu: Add SID information to context fault log

Extract the SID and add the information to context fault log. This is specially useful in a distributed smmu architecture where multiple masters are connected to smmu. SID information helps to quickly identify the faulting master device.

---
 drivers/iommu/arm-smmu-regs.h |  4 ++++
 drivers/iommu/arm-smmu.c      | 14 ++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/iommu/arm-smmu-regs.h +4 -0
index a1226e4ab5f8..e5be0344b610 100644
@@ -147,6 +147,10 @@ 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 CBFRSYNRA_V2_SID_MASK		0xffff
+#define CBFRSYNRA_V1_SID_MASK		0x7fff
+
 #define ARM_SMMU_GR1_CBA2R(n)		(0x800 + ((n) << 2))
 #define CBA2R_RW64_32BIT		(0 << 0)
 #define CBA2R_RW64_64BIT		(1 << 0)
drivers/iommu/arm-smmu.c +12 -2
index 045d93884164..aa3426dc68d0 100644
@@ -575,7 +575,10 @@ 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;
+	u16 sid;
 
 	cb_base = ARM_SMMU_CB(smmu, cfg->cbndx);
 	fsr = readl_relaxed(cb_base + ARM_SMMU_CB_FSR);
@@ -586,9 +589,16 @@ 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));
+	if (smmu->version > ARM_SMMU_V1)
+		sid = cbfrsynra & CBFRSYNRA_V2_SID_MASK;
+	else
+		sid = cbfrsynra & CBFRSYNRA_V1_SID_MASK;
+
 	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, cb=%d sid = %u\n",
+			    fsr, iova, fsynr, cfg->cbndx, sid);
 
 	writel(fsr, cb_base + ARM_SMMU_CB_FSR);
 	return IRQ_HANDLED;
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
#1 lore raw

Trimming CC list for very minor suggestions (feel free to ignore).

Quoted 4 lines · Vivek Gautam

Extract the SID and add the information to context fault log. This is specially useful in a distributed smmu architecture where multiple masters are connected to smmu. SID information helps to quickly identify the faulting master device.

I find it slightly clearer to keep acronyms capitalized, such as SMMU.

Quoted 12 lines
drivers/iommu/arm-smmu.c +3 -0
@@ -575,7 +575,10 @@ 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;
+	u16 sid;
 
 	cb_base = ARM_SMMU_CB(smmu, cfg->cbndx);
 	fsr = readl_relaxed(cb_base + ARM_SMMU_CB_FSR);

drivers/iommu/arm-smmu.c static irqreturn_t arm_smmu_context_fault(int irq, void *dev) · line 593

Quoted 5 lines
drivers/iommu/arm-smmu.c +2 -0
@@ -586,9 +589,16 @@ 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));

I find it slightly clearer to write

	void __iomem *reg;
	...
	reg = ARM_SMMU_GR1(smmu) + ARM_SMMU_GR1_CBFRSYNRA(cfg->cbndx);
	cbfrsynra = readl_relaxed(reg);

Regards.

#2 lore raw

Hi Marc,

Quoted 1 line · Marc Gonzalez

Trimming CC list for very minor suggestions (feel free to ignore)

Thanks for the review. Please find my responses inline below.

Quoted 8 lines · Vivek Gautam
Quoted 5 lines

Extract the SID and add the information to context fault log. This is specially useful in a distributed smmu architecture where multiple masters are connected to smmu. SID information helps to quickly identify the faulting master device.

I find it slightly clearer to keep acronyms capitalized, such as SMMU.

Sure, will change it.

Quoted 17 lines
Quoted 17 lines
drivers/iommu/arm-smmu.c +3 -0
@@ -575,7 +575,10 @@ 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;
+	u16 sid;
 
  	cb_base = ARM_SMMU_CB(smmu, cfg->cbndx);
  	fsr = readl_relaxed(cb_base + ARM_SMMU_CB_FSR);
@@ -586,9 +589,16 @@ 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);
 
Quoted 8 lines

drivers/iommu/arm-smmu.c static irqreturn_t arm_smmu_context_fault(int irq, void *dev) · line 593

Quoted 2 lines
drivers/iommu/arm-smmu.c +2 -0
+	cbfrsynra = readl_relaxed(gr1_base +
+				  ARM_SMMU_GR1_CBFRSYNRA(cfg->cbndx));

I find it slightly clearer to write

	void __iomem *reg;
	...
	reg = ARM_SMMU_GR1(smmu) + ARM_SMMU_GR1_CBFRSYNRA(cfg->cbndx);
	cbfrsynra = readl_relaxed(reg);

I would actually argue here, to go with the flow of how this function declares the variables, for the simple case of symmetry. Let me know what do you think.

Thanks & regards
Vivek

Quoted 2 lines

Regards.

reviewer
#3 lore raw
In reply to Vivek Gautam
Quoted 4 lines · Vivek Gautam

Extract the SID and add the information to context fault log. This is specially useful in a distributed smmu architecture where multiple masters are connected to smmu. SID information helps to quickly identify the faulting master device.

Hmm, given how it's UNKNOWN for translation faults, which are arguably the most likely context fault, I reckon it probably makes more sense to just dump the raw register value for the user to interpret, as we do for fsr/fsynr.

Robin.

Quoted 56 lines
---
  drivers/iommu/arm-smmu-regs.h |  4 ++++
  drivers/iommu/arm-smmu.c      | 14 ++++++++++++--
  2 files changed, 16 insertions(+), 2 deletions(-)
drivers/iommu/arm-smmu-regs.h +4 -0
index a1226e4ab5f8..e5be0344b610 100644
@@ -147,6 +147,10 @@ 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 CBFRSYNRA_V2_SID_MASK		0xffff
+#define CBFRSYNRA_V1_SID_MASK		0x7fff
+
  #define ARM_SMMU_GR1_CBA2R(n)		(0x800 + ((n) << 2))
  #define CBA2R_RW64_32BIT		(0 << 0)
  #define CBA2R_RW64_64BIT		(1 << 0)
drivers/iommu/arm-smmu.c +12 -2
index 045d93884164..aa3426dc68d0 100644
@@ -575,7 +575,10 @@ 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;
+	u16 sid;
 
  	cb_base = ARM_SMMU_CB(smmu, cfg->cbndx);
  	fsr = readl_relaxed(cb_base + ARM_SMMU_CB_FSR);
@@ -586,9 +589,16 @@ 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));
+	if (smmu->version > ARM_SMMU_V1)
+		sid = cbfrsynra & CBFRSYNRA_V2_SID_MASK;
+	else
+		sid = cbfrsynra & CBFRSYNRA_V1_SID_MASK;
+
  	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, cb=%d sid = %u\n",
+			    fsr, iova, fsynr, cfg->cbndx, sid);
 
  	writel(fsr, cb_base + ARM_SMMU_CB_FSR);
  	return IRQ_HANDLED;
#4 lore raw
Quoted 7 lines · Robin Murphy
Quoted 4 lines · Vivek Gautam

Extract the SID and add the information to context fault log. This is specially useful in a distributed smmu architecture where multiple masters are connected to smmu. SID information helps to quickly identify the faulting master device.

Hmm, given how it's UNKNOWN for translation faults, which are arguably the most likely context fault, I reckon it probably makes more sense to just dump the raw register value for the user to interpret, as we do for fsr/fsynr.

Thanks Robin. Sure will update it to dump the raw register value.

Regards
Vivek

Quoted 51 lines

Robin.

Quoted 48 lines

---
  drivers/iommu/arm-smmu-regs.h |  4 ++++ drivers/iommu/arm-smmu.c      | 14 ++++++++++++--

  2 files changed, 16 insertions(+), 2 deletions(-)
drivers/iommu/arm-smmu-regs.h +3 -0
index a1226e4ab5f8..e5be0344b610 100644
@@ -147,6 +147,10 @@ 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 CBFRSYNRA_V2_SID_MASK        0xffff
+#define CBFRSYNRA_V1_SID_MASK        0x7fff
+
   #define ARM_SMMU_GR1_CBA2R(n)        (0x800 + ((n) << 2))
   #define CBA2R_RW64_32BIT        (0 << 0)
   #define CBA2R_RW64_64BIT        (1 << 0)
drivers/iommu/arm-smmu.c +3 -0
index 045d93884164..aa3426dc68d0 100644
@@ -575,7 +575,10 @@ 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;
+    u16 sid;
         cb_base = ARM_SMMU_CB(smmu, cfg->cbndx);
       fsr = readl_relaxed(cb_base + ARM_SMMU_CB_FSR);
@@ -586,9 +589,16 @@ 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)); +    if (smmu->version > ARM_SMMU_V1)
+        sid = cbfrsynra & CBFRSYNRA_V2_SID_MASK;
+    else
+        sid = cbfrsynra & CBFRSYNRA_V1_SID_MASK;
+
      dev_err_ratelimited(smmu->dev,
-    "Unhandled context fault: fsr=0x%x, iova=0x%08lx, fsynr=0x%x,

Quoted 8 lines
Quoted 8 lines

cb=%d\n",
-                fsr, iova, fsynr, cfg->cbndx);
+    "Unhandled context fault: fsr=0x%x, iova=0x%08lx, fsynr=0x%x, cb=%d sid = %u\n",
+                fsr, iova, fsynr, cfg->cbndx, sid); writel(fsr, cb_base + ARM_SMMU_CB_FSR);
      return IRQ_HANDLED;

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

#5 lore raw

PATCH 1/1 iommu/arm-smmu: Log CBFRSYNRA register on context fault

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.

---

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(-)
drivers/iommu/arm-smmu-regs.h +2 -0
index a1226e4ab5f8..e9132a926761 100644
@@ -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)
drivers/iommu/arm-smmu.c +6 -2
index 045d93884164..a4773e8c6b0e 100644
@@ -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));
 
 	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",
+			    fsr, iova, fsynr, cbfrsynra, cfg->cbndx);
 
 	writel(fsr, cb_base + ARM_SMMU_CB_FSR);
 	return IRQ_HANDLED;
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
Reviewed-by on v1 1/1
#6 lore raw

Re: [PATCH 1/1] iommu/arm-smmu: Log CBFRSYNRA register on context fault

Quoted 51 lines · Vivek Gautam

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.

---

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(-)
drivers/iommu/arm-smmu-regs.h +2 -0
index a1226e4ab5f8..e9132a926761 100644
@@ -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)
drivers/iommu/arm-smmu.c +2 -0
index 045d93884164..a4773e8c6b0e 100644
@@ -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);

drivers/iommu/arm-smmu.c static irqreturn_t arm_smmu_context_fault(int irq, void *dev) · line 591

Quoted 5 lines
drivers/iommu/arm-smmu.c +2 -0
@@ -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.

drivers/iommu/arm-smmu.c static irqreturn_t arm_smmu_context_fault(int irq, void *dev) · line 594

Quoted 5 lines
drivers/iommu/arm-smmu.c +1 -2
 	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

Regards,
Bjorn

Quoted 8 lines
drivers/iommu/arm-smmu.c +1 -1
+			    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

#7 lore raw

Re: [PATCH 1/1] iommu/arm-smmu: Log CBFRSYNRA register on context fault

Quoted 69 lines · Bjorn Andersson
Quoted 51 lines · Vivek Gautam

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.

---

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(-)
drivers/iommu/arm-smmu-regs.h +2 -0
index a1226e4ab5f8..e9132a926761 100644
@@ -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)
drivers/iommu/arm-smmu.c +2 -0
index 045d93884164..a4773e8c6b0e 100644
@@ -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);

drivers/iommu/arm-smmu.c static irqreturn_t arm_smmu_context_fault(int irq, void *dev) · line 591

Quoted 5 lines
drivers/iommu/arm-smmu.c +2 -0
@@ -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.

drivers/iommu/arm-smmu.c static irqreturn_t arm_smmu_context_fault(int irq, void *dev) · line 594

Quoted 5 lines
drivers/iommu/arm-smmu.c +1 -2
      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",
Quoted 5 lines

Drop the spaces around '='.

With those addressed, you have my

Thanks for the review Bjorn. Will address above comments and respin.

Best regards
Vivek

Quoted 16 lines

Regards,
Bjorn

Quoted 8 lines
drivers/iommu/arm-smmu.c +1 -1
+                         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

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation