]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/gt: Synchronize GT reset with device unbind
authorBalasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Mon, 3 Nov 2025 12:31:46 +0000 (18:01 +0530)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 3 Nov 2025 19:29:00 +0000 (11:29 -0800)
When unbinding wait for any GT reset in progress to complete. Unbinding
will release the mmio mapping but mmio operations are performed during
GT reset causing Kernel panic.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patch.msgid.link/20251103123144.3231829-5-balasubramani.vivekanandan@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_gt.c

index 60bac65c8b9d7567f7c6d5eb02f955e28b30c261..e008e3c1bf680b4645692209ebeb03f2faa40ab2 100644 (file)
@@ -607,6 +607,13 @@ static void xe_gt_fini(void *arg)
        struct xe_gt *gt = arg;
        int i;
 
+       if (disable_work_sync(&gt->reset.worker))
+               /*
+                * If gt_reset_worker was halted from executing, take care of
+                * releasing the rpm reference here.
+                */
+               xe_pm_runtime_put(gt_to_xe(gt));
+
        for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
                xe_hw_fence_irq_finish(&gt->fence_irq[i]);