[igt-dev] [PATCH v3 10/10] tests/panfrost: Add a test to validate unhandled pagefault handling

Boris Brezillon boris.brezillon at collabora.com
Fri Jun 25 14:01:18 UTC 2021


We want to make sure jobs that trigger unhandled page fault get killed
immediately, and jobs queued to the same context after the pagefault
occured get executed properly.

v3:
* New patch

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
---
 tests/panfrost_submit.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tests/panfrost_submit.c b/tests/panfrost_submit.c
index 070d78625ebf..4747d295724e 100644
--- a/tests/panfrost_submit.c
+++ b/tests/panfrost_submit.c
@@ -168,6 +168,34 @@ igt_main
                 close(tmpfd);
         }
 
+        igt_subtest("pan-unhandled-pagefault") {
+                struct mali_job_descriptor_header *header;
+                struct panfrost_submit *submit;
+
+                submit = igt_panfrost_write_value_job(fd, true);
+                do_ioctl(fd, DRM_IOCTL_PANFROST_SUBMIT, submit->args);
+                header = submit->submit_bo->map;
+                igt_assert(syncobj_wait(fd, &submit->args->out_sync, 1,
+                                        abs_timeout(SHORT_TIME_NSEC), 0, NULL));
+
+                /* The job should get a JOB_BUS_FAULT, but it's not reflected
+                 * in the job header because the MMU mapping is disabled (to kill
+                 * the job immediately) before the job manager has a chance to
+                 * update the exception status.
+                 */
+                igt_assert(header->exception_status != 1);
+                igt_panfrost_free_job(fd, submit);
+
+                /* Now make sure new jobs on this context get executed properly */
+                submit = igt_panfrost_write_value_job(fd, false);
+                do_ioctl(fd, DRM_IOCTL_PANFROST_SUBMIT, submit->args);
+                header = submit->submit_bo->map;
+                igt_assert(syncobj_wait(fd, &submit->args->out_sync, 1,
+                                        abs_timeout(SHORT_TIME_NSEC), 0, NULL));
+                check_done(header);
+                igt_panfrost_free_job(fd, submit);
+        }
+
         igt_fixture {
                 close(fd);
         }
-- 
2.31.1



More information about the igt-dev mailing list