aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2018-01-19 06:22:30 -0500
committerLucas Stach <l.stach@pengutronix.de>2018-03-09 06:22:35 -0500
commit4df3000ebcc43af39e3312e2c0d084dcd625c758 (patch)
treefc512b0e5fc80d56964d8983ab613af0e8f77a41
parent246774d17fc05a9b33c769c937003cc73d258674 (diff)
drm/etnaviv: split out and optimize MMU fault dumping
Split out the fault dumping, as this will get more complex in the future. Also there is no need to read and dump the fault address from MMUs that didn't signal a fault. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gpu.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 94fa3d3244fb..ee2486159ea7 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1297,9 +1297,22 @@ static void sync_point_worker(struct work_struct *work)
1297 etnaviv_gpu_start_fe(gpu, addr + 2, 2); 1297 etnaviv_gpu_start_fe(gpu, addr + 2, 2);
1298} 1298}
1299 1299
1300/* 1300static void dump_mmu_fault(struct etnaviv_gpu *gpu)
1301 * Init/Cleanup: 1301{
1302 */ 1302 u32 status = gpu_read(gpu, VIVS_MMUv2_STATUS);
1303 int i;
1304
1305 dev_err_ratelimited(gpu->dev, "MMU fault status 0x%08x\n", status);
1306
1307 for (i = 0; i < 4; i++) {
1308 if (!(status & (VIVS_MMUv2_STATUS_EXCEPTION0__MASK << (i * 4))))
1309 continue;
1310
1311 dev_err_ratelimited(gpu->dev, "MMU %d fault addr 0x%08x\n", i,
1312 gpu_read(gpu, VIVS_MMUv2_EXCEPTION_ADDR(i)));
1313 }
1314}
1315
1303static irqreturn_t irq_handler(int irq, void *data) 1316static irqreturn_t irq_handler(int irq, void *data)
1304{ 1317{
1305 struct etnaviv_gpu *gpu = data; 1318 struct etnaviv_gpu *gpu = data;
@@ -1320,17 +1333,7 @@ static irqreturn_t irq_handler(int irq, void *data)
1320 } 1333 }
1321 1334
1322 if (intr & VIVS_HI_INTR_ACKNOWLEDGE_MMU_EXCEPTION) { 1335 if (intr & VIVS_HI_INTR_ACKNOWLEDGE_MMU_EXCEPTION) {
1323 int i; 1336 dump_mmu_fault(gpu);
1324
1325 dev_err_ratelimited(gpu->dev,
1326 "MMU fault status 0x%08x\n",
1327 gpu_read(gpu, VIVS_MMUv2_STATUS));
1328 for (i = 0; i < 4; i++) {
1329 dev_err_ratelimited(gpu->dev,
1330 "MMU %d fault addr 0x%08x\n",
1331 i, gpu_read(gpu,
1332 VIVS_MMUv2_EXCEPTION_ADDR(i)));
1333 }
1334 intr &= ~VIVS_HI_INTR_ACKNOWLEDGE_MMU_EXCEPTION; 1337 intr &= ~VIVS_HI_INTR_ACKNOWLEDGE_MMU_EXCEPTION;
1335 } 1338 }
1336 1339