aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/iommu/arm-smmu.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 4f49fe29f202..2db74ebc3240 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -686,8 +686,7 @@ static struct iommu_gather_ops arm_smmu_gather_ops = {
686 686
687static irqreturn_t arm_smmu_context_fault(int irq, void *dev) 687static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
688{ 688{
689 int flags, ret; 689 u32 fsr, fsynr;
690 u32 fsr, fsynr, resume;
691 unsigned long iova; 690 unsigned long iova;
692 struct iommu_domain *domain = dev; 691 struct iommu_domain *domain = dev;
693 struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); 692 struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
@@ -701,34 +700,15 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
701 if (!(fsr & FSR_FAULT)) 700 if (!(fsr & FSR_FAULT))
702 return IRQ_NONE; 701 return IRQ_NONE;
703 702
704 if (fsr & FSR_IGN)
705 dev_err_ratelimited(smmu->dev,
706 "Unexpected context fault (fsr 0x%x)\n",
707 fsr);
708
709 fsynr = readl_relaxed(cb_base + ARM_SMMU_CB_FSYNR0); 703 fsynr = readl_relaxed(cb_base + ARM_SMMU_CB_FSYNR0);
710 flags = fsynr & FSYNR0_WNR ? IOMMU_FAULT_WRITE : IOMMU_FAULT_READ;
711
712 iova = readq_relaxed(cb_base + ARM_SMMU_CB_FAR); 704 iova = readq_relaxed(cb_base + ARM_SMMU_CB_FAR);
713 if (!report_iommu_fault(domain, smmu->dev, iova, flags)) {
714 ret = IRQ_HANDLED;
715 resume = RESUME_RETRY;
716 } else {
717 dev_err_ratelimited(smmu->dev,
718 "Unhandled context fault: iova=0x%08lx, fsynr=0x%x, cb=%d\n",
719 iova, fsynr, cfg->cbndx);
720 ret = IRQ_NONE;
721 resume = RESUME_TERMINATE;
722 }
723
724 /* Clear the faulting FSR */
725 writel(fsr, cb_base + ARM_SMMU_CB_FSR);
726 705
727 /* Retry or terminate any stalled transactions */ 706 dev_err_ratelimited(smmu->dev,
728 if (fsr & FSR_SS) 707 "Unhandled context fault: fsr=0x%x, iova=0x%08lx, fsynr=0x%x, cb=%d\n",
729 writel_relaxed(resume, cb_base + ARM_SMMU_CB_RESUME); 708 fsr, iova, fsynr, cfg->cbndx);
730 709
731 return ret; 710 writel(fsr, cb_base + ARM_SMMU_CB_FSR);
711 return IRQ_HANDLED;
732} 712}
733 713
734static irqreturn_t arm_smmu_global_fault(int irq, void *dev) 714static irqreturn_t arm_smmu_global_fault(int irq, void *dev)
@@ -837,7 +817,7 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain,
837 } 817 }
838 818
839 /* SCTLR */ 819 /* SCTLR */
840 reg = SCTLR_CFCFG | SCTLR_CFIE | SCTLR_CFRE | SCTLR_M | SCTLR_EAE_SBOP; 820 reg = SCTLR_CFIE | SCTLR_CFRE | SCTLR_M | SCTLR_EAE_SBOP;
841 if (stage1) 821 if (stage1)
842 reg |= SCTLR_S1_ASIDPNE; 822 reg |= SCTLR_S1_ASIDPNE;
843#ifdef __BIG_ENDIAN 823#ifdef __BIG_ENDIAN