msm: kgsl: On pagefault stall GPU so that it hangs
Prevent the iommu fault handler from clearing the stalled status
of GPU on page fault. This will cause a GPU hang and print out
the snapshot that will help in fault analysis.
Change-Id: I9dcab83a098a988f86a0c03c46b0dbe6624de937
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c
index f394422..6a8bde8 100644
--- a/drivers/gpu/msm/adreno.c
+++ b/drivers/gpu/msm/adreno.c
@@ -1464,6 +1464,7 @@
ret = -ENOMEM;
goto done;
}
+ rec_data->fault = device->mmu.fault;
done:
if (ret) {
@@ -1526,9 +1527,9 @@
goto done;
}
- /* Do not try the bad caommands if recovery has failed bad commands
- * once already */
- if (!try_bad_commands)
+ /* Do not try the bad commands if recovery has failed bad commands
+ * once already or if hang is due to a fault */
+ if (!try_bad_commands || rec_data->fault)
rec_data->bad_rb_size = 0;
if (rec_data->bad_rb_size) {