mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josue Albarran <j-albarran@ti.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: <iommu@lists.linux-foundation.org>,
	<linux-kernel@vger.kernel.org>, Suman Anna <s-anna@ti.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	<linux-omap@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH 1/2] iommu/omap: Fix disabling of MMU upon a fault
Date: Fri, 28 Jul 2017 15:49:13 -0500	[thread overview]
Message-ID: <1501274954-20973-2-git-send-email-j-albarran@ti.com> (raw)
In-Reply-To: <1501274954-20973-1-git-send-email-j-albarran@ti.com>

From: Fernando Guzman Lugo <fernando.lugo@ti.com>

The IOMMU framework lets its client users be notified on a
MMU fault and allows them to either handle the interrupt by
dynamic reloading of an appropriate TLB/PTE for the offending
fault address or to completely restart/recovery the device
and its IOMMU.

The OMAP remoteproc driver performs the latter option, and
does so after unwinding the previous mappings. The OMAP IOMMU
fault handler however disables the MMU and cuts off the clock
upon a MMU fault at present, resulting in an interconnect abort
during any subsequent operation that touches the MMU registers.

So, disable the IP-level fault interrupts instead of disabling
the MMU, to allow continued MMU register operations as well as
to avoid getting interrupted again.

Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
[s-anna@ti.com: add commit description]
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Josue Albarran <j-albarran@ti.com>
---
 drivers/iommu/omap-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 641e035cf866..10c9de8de45d 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -786,7 +786,7 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
 	if (!report_iommu_fault(domain, obj->dev, da, 0))
 		return IRQ_HANDLED;
 
-	iommu_disable(obj);
+	iommu_write_reg(obj, 0, MMU_IRQENABLE);
 
 	iopgd = iopgd_offset(obj, da);
 
-- 
2.7.4

  reply	other threads:[~2017-07-28 20:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 20:49 [PATCH 0/2] iommu/omap: Rework cache functionality with DMA Streaming API Josue Albarran
2017-07-28 20:49 ` Josue Albarran [this message]
2017-07-28 20:49 ` [PATCH 2/2] iommu/omap: Use DMA-API for performing cache flushes Josue Albarran
2017-08-01 17:38   ` Suman Anna
2017-08-04  9:59 ` [PATCH 0/2] iommu/omap: Rework cache functionality with DMA Streaming API Joerg Roedel
2017-08-09 11:20 ` Laurent Pinchart

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=1501274954-20973-2-git-send-email-j-albarran@ti.com \
    --to=j-albarran@ti.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=s-anna@ti.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

all inboxes | Powered by JetHome®