Skip to content

Commit 761f916

Browse files
matt-auldlucasdemarchi
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 <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Nirmoy Das <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit a187c1b) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 03a86c2 commit 761f916

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)