]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/xe: Allow the pm notifier to continue on failure
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Thu, 4 Sep 2025 16:07:14 +0000 (18:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:37:32 +0000 (16:37 +0200)
commit d84820309ed34cc412ce76ecfa9471dae7d7d144 upstream.

Its actions are opportunistic anyway and will be completed
on device suspend.

Marking as a fix to simplify backporting of the fix
that follows in the series.

v2:
- Keep the runtime pm reference over suspend / hibernate and
  document why. (Matt Auld, Rodrigo Vivi):

Fixes: c6a4d46ec1d7 ("drm/xe: evict user memory in PM notifier")
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: <stable@vger.kernel.org> # v6.16+
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/20250904160715.2613-3-thomas.hellstrom@linux.intel.com
(cherry picked from commit ebd546fdffddfcaeab08afdd68ec93052c8fa740)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/xe/xe_pm.c

index ad263de44111d4468c6be62bcdbe6518c2b0eced..2a0ac2347ffd0000253e3a61e364db07845955a4 100644 (file)
@@ -296,17 +296,17 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
        case PM_SUSPEND_PREPARE:
                xe_pm_runtime_get(xe);
                err = xe_bo_evict_all_user(xe);
-               if (err) {
+               if (err)
                        drm_dbg(&xe->drm, "Notifier evict user failed (%d)\n", err);
-                       xe_pm_runtime_put(xe);
-                       break;
-               }
 
                err = xe_bo_notifier_prepare_all_pinned(xe);
-               if (err) {
+               if (err)
                        drm_dbg(&xe->drm, "Notifier prepare pin failed (%d)\n", err);
-                       xe_pm_runtime_put(xe);
-               }
+               /*
+                * Keep the runtime pm reference until post hibernation / post suspend to
+                * avoid a runtime suspend interfering with evicted objects or backup
+                * allocations.
+                */
                break;
        case PM_POST_HIBERNATION:
        case PM_POST_SUSPEND:
@@ -315,9 +315,6 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
                break;
        }
 
-       if (err)
-               return NOTIFY_BAD;
-
        return NOTIFY_DONE;
 }