Skip to content

Commit a187c1b

Browse files
committed
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: 452bca0 ("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]
1 parent cfcbc05 commit a187c1b

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
@@ -1016,13 +1016,13 @@ void xe_device_declare_wedged(struct xe_device *xe)
10161016
return;
10171017
}
10181018

1019+
xe_pm_runtime_get_noresume(xe);
1020+
10191021
if (drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe)) {
10201022
drm_err(&xe->drm, "Failed to register xe_device_wedged_fini clean-up. Although device is wedged.\n");
10211023
return;
10221024
}
10231025

1024-
xe_pm_runtime_get_noresume(xe);
1025-
10261026
if (!atomic_xchg(&xe->wedged.flag, 1)) {
10271027
xe->needs_flr_on_fini = true;
10281028
drm_err(&xe->drm,

0 commit comments

Comments
 (0)