[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190913055052.25599-2-christian.gmeiner@gmail.com>
Date: Fri, 13 Sep 2019 07:50:37 +0200
From: Christian Gmeiner <christian.gmeiner@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Christian Gmeiner <christian.gmeiner@...il.com>,
Lucas Stach <l.stach@...gutronix.de>,
Russell King <linux+etnaviv@...linux.org.uk>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>, etnaviv@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org
Subject: [PATCH v2 2/2] drm/etnaviv: print MMU exception cause
Might be useful when debugging MMU exceptions.
Changes in V2:
- Use a static array of string for error message as suggested
by Lucas Stach.
Signed-off-by: Christian Gmeiner <christian.gmeiner@...il.com>
---
drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index d47d1a8e0219..b8cd85153fe0 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1351,6 +1351,15 @@ static void sync_point_worker(struct work_struct *work)
static void dump_mmu_fault(struct etnaviv_gpu *gpu)
{
+ static const char *errors[] = {
+ "slave not present",
+ "page not present",
+ "write violation",
+ "out of bound",
+ "read security violation",
+ "write security violation",
+ };
+
u32 status_reg, status;
int i;
@@ -1364,10 +1373,16 @@ static void dump_mmu_fault(struct etnaviv_gpu *gpu)
for (i = 0; i < 4; i++) {
u32 address_reg;
+ const char *error = "unknown state";
if (!(status & (VIVS_MMUv2_STATUS_EXCEPTION0__MASK << (i * 4))))
continue;
+ if (status < ARRAY_SIZE(errors))
+ error = errors[status];
+
+ dev_err_ratelimited(gpu->dev, "MMU %d %s\n", i, error);
+
if (gpu->sec_mode == ETNA_SEC_NONE)
address_reg = VIVS_MMUv2_EXCEPTION_ADDR(i);
else
--
2.21.0
Powered by blists - more mailing lists