Skip to content

Commit 761f916

Browse files
matt-auldLucas De Marchi
authored andcommitted
drm/xe: fix unbalanced rpm put() with declare_wedged()
Technically the or_reset() means we call the action on failure, however that would lead to unbalanced rpm put(). Move the get() earlier to fix this. It should be extremely unlikely to ever trigger this in practice. Fixes: 90936a0 ("drm/xe: Don't suspend device upon wedge") Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Nirmoy Das <nirmoy.das@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241009084808.204432-4-matthew.auld@intel.com (cherry picked from commit a187c1b) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 03a86c2 commit 761f916

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/xe/xe_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,13 +980,13 @@ void xe_device_declare_wedged(struct xe_device *xe)
980980
return;
981981
}
982982

983+
xe_pm_runtime_get_noresume(xe);
984+
983985
if (drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe)) {
984986
drm_err(&xe->drm, "Failed to register xe_device_wedged_fini clean-up. Although device is wedged.\n");
985987
return;
986988
}
987989

988-
xe_pm_runtime_get_noresume(xe);
989-
990990
if (!atomic_xchg(&xe->wedged.flag, 1)) {
991991
xe->needs_flr_on_fini = true;
992992
drm_err(&xe->drm,

0 commit comments

Comments
 (0)