These fix how jobs are handled when their JM context is destroyed, explicitly or because the file is closed, and the error path of JM context creation.
Patch 1 makes a job hold a reference to its MMU context. Patch 2 makes panfrost_jm_ctx_destroy() find the jobs of the context again: it looks them up by job->base.entity, which the scheduler clears when it pops a job. Patch 3 stops a job that is queued after its context was destroyed. Patch 4 keeps panfrost_jm_ctx_create() from destroying entities that it never initialized when it fails. Changes in v2: - New patch 2, and new patch 4 for a related issue, both reported by Sashiko on v1. - Patches 1 and 3: changelogs updated, as panfrost_jm_ctx_destroy() did not actually stop any job before patch 2. v1: https://lore.kernel.org/r/[email protected] Jiwoo Kim (4): drm/panfrost: Hold a reference to the MMU context of a job drm/panfrost: Find the jobs of a destroyed JM context by their context drm/panfrost: Stop a job queued after its JM context was destroyed drm/panfrost: Don't destroy uninitialized entities of a new JM context drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +- drivers/gpu/drm/panfrost/panfrost_job.c | 91 +++++++++++++++++-------- 2 files changed, 62 insertions(+), 31 deletions(-) base-commit: d48ea86919434695da12d280dccab72b094397e1 -- 2.43.0
