Skip to content

Commit

Permalink
drm/xe: Add missing runtime reference to wedged upon gt_reset
Browse files Browse the repository at this point in the history
Fixes this missed case:

xe 0000:00:02.0: [drm] Missing outer runtime PM protection
WARNING: CPU: 99 PID: 1455 at drivers/gpu/drm/xe/xe_pm.c:564 xe_pm_runtime_get_noresume+0x48/0x60 [xe]
Call Trace:
<TASK>
? show_regs+0x67/0x70
? __warn+0x94/0x1b0
? xe_pm_runtime_get_noresume+0x48/0x60 [xe]
? report_bug+0x1b7/0x1d0
? handle_bug+0x46/0x80
? exc_invalid_op+0x19/0x70
? asm_exc_invalid_op+0x1b/0x20
? xe_pm_runtime_get_noresume+0x48/0x60 [xe]
xe_device_declare_wedged+0x91/0x280 [xe]
gt_reset_worker+0xa2/0x250 [xe]

v2: Also move get and get the right Fixes tag (Himal, Brost)

Fixes: fb74b20 ("drm/xe: Introduce a simple wedged state")
Cc: Himal Prasad Ghimiray <[email protected]>
Cc: Matthew Brost <[email protected]>
Reviewed-by: Jonathan Cavitt <[email protected]>
Reviewed-by: Himal Prasad Ghimiray <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Rodrigo Vivi <[email protected]>
  • Loading branch information
rodrigovivi committed Sep 3, 2024
1 parent 9f6b479 commit bc947d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/xe/xe_gt.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,13 @@ static int gt_reset(struct xe_gt *gt)

xe_gt_info(gt, "reset started\n");

xe_pm_runtime_get(gt_to_xe(gt));

if (xe_fault_inject_gt_reset()) {
err = -ECANCELED;
goto err_fail;
}

xe_pm_runtime_get(gt_to_xe(gt));
xe_gt_sanitize(gt);

err = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
Expand Down Expand Up @@ -792,11 +793,11 @@ static int gt_reset(struct xe_gt *gt)
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
err_msg:
XE_WARN_ON(xe_uc_start(&gt->uc));
xe_pm_runtime_put(gt_to_xe(gt));
err_fail:
xe_gt_err(gt, "reset failed (%pe)\n", ERR_PTR(err));

xe_device_declare_wedged(gt_to_xe(gt));
xe_pm_runtime_put(gt_to_xe(gt));

return err;
}
Expand Down

0 comments on commit bc947d9

Please sign in to comment.