Skip to content

Commit 41dacb3

Browse files
committed
Merge tag 'drm-xe-fixes-2025-10-30' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
Driver Changes: - Fix xe_validation_guard() not guarding (Thomas Hellström) - Do not wake device during a GT reset (Matthew Brost) Signed-off-by: Simona Vetter <[email protected]> From: Lucas De Marchi <[email protected]> Link: https://patch.msgid.link/o2b3lucyitafbbcd5bewpfqnslavtnnpc6ck4qatnou2wwukix@rz6seyfw75uy
2 parents b095398 + b3fbda1 commit 41dacb3

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

drivers/gpu/drm/xe/xe_gt.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -813,21 +813,23 @@ static int gt_reset(struct xe_gt *gt)
813813
unsigned int fw_ref;
814814
int err;
815815

816-
if (xe_device_wedged(gt_to_xe(gt)))
817-
return -ECANCELED;
816+
if (xe_device_wedged(gt_to_xe(gt))) {
817+
err = -ECANCELED;
818+
goto err_pm_put;
819+
}
818820

819821
/* We only support GT resets with GuC submission */
820-
if (!xe_device_uc_enabled(gt_to_xe(gt)))
821-
return -ENODEV;
822+
if (!xe_device_uc_enabled(gt_to_xe(gt))) {
823+
err = -ENODEV;
824+
goto err_pm_put;
825+
}
822826

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

825829
err = gt_wait_reset_unblock(gt);
826830
if (!err)
827831
xe_gt_warn(gt, "reset block failed to get lifted");
828832

829-
xe_pm_runtime_get(gt_to_xe(gt));
830-
831833
if (xe_fault_inject_gt_reset()) {
832834
err = -ECANCELED;
833835
goto err_fail;
@@ -874,6 +876,7 @@ static int gt_reset(struct xe_gt *gt)
874876
xe_gt_err(gt, "reset failed (%pe)\n", ERR_PTR(err));
875877

876878
xe_device_declare_wedged(gt_to_xe(gt));
879+
err_pm_put:
877880
xe_pm_runtime_put(gt_to_xe(gt));
878881

879882
return err;
@@ -895,7 +898,9 @@ void xe_gt_reset_async(struct xe_gt *gt)
895898
return;
896899

897900
xe_gt_info(gt, "reset queued\n");
898-
queue_work(gt->ordered_wq, &gt->reset.worker);
901+
xe_pm_runtime_get_noresume(gt_to_xe(gt));
902+
if (!queue_work(gt->ordered_wq, &gt->reset.worker))
903+
xe_pm_runtime_put(gt_to_xe(gt));
899904
}
900905

901906
void xe_gt_suspend_prepare(struct xe_gt *gt)

drivers/gpu/drm/xe/xe_validation.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ xe_validation_device_init(struct xe_validation_device *val)
166166
*/
167167
DEFINE_CLASS(xe_validation, struct xe_validation_ctx *,
168168
if (_T) xe_validation_ctx_fini(_T);,
169-
({_ret = xe_validation_ctx_init(_ctx, _val, _exec, _flags);
170-
_ret ? NULL : _ctx; }),
169+
({*_ret = xe_validation_ctx_init(_ctx, _val, _exec, _flags);
170+
*_ret ? NULL : _ctx; }),
171171
struct xe_validation_ctx *_ctx, struct xe_validation_device *_val,
172-
struct drm_exec *_exec, const struct xe_val_flags _flags, int _ret);
172+
struct drm_exec *_exec, const struct xe_val_flags _flags, int *_ret);
173173
static inline void *class_xe_validation_lock_ptr(class_xe_validation_t *_T)
174174
{return *_T; }
175175
#define class_xe_validation_is_conditional true
@@ -186,7 +186,7 @@ static inline void *class_xe_validation_lock_ptr(class_xe_validation_t *_T)
186186
* exhaustive eviction.
187187
*/
188188
#define xe_validation_guard(_ctx, _val, _exec, _flags, _ret) \
189-
scoped_guard(xe_validation, _ctx, _val, _exec, _flags, _ret) \
189+
scoped_guard(xe_validation, _ctx, _val, _exec, _flags, &_ret) \
190190
drm_exec_until_all_locked(_exec)
191191

192192
#endif

0 commit comments

Comments
 (0)