Commit 41dacb39 authored by Simona Vetter's avatar Simona Vetter
Browse files

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: default avatarSimona Vetter <simona.vetter@ffwll.ch>
From: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patch.msgid.link/o2b3lucyitafbbcd5bewpfqnslavtnnpc6ck4qatnou2wwukix@rz6seyfw75uy
parents b0953985 b3fbda1a
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -813,12 +813,16 @@ static int gt_reset(struct xe_gt *gt)
	unsigned int fw_ref;
	int err;

	if (xe_device_wedged(gt_to_xe(gt)))
		return -ECANCELED;
	if (xe_device_wedged(gt_to_xe(gt))) {
		err = -ECANCELED;
		goto err_pm_put;
	}

	/* We only support GT resets with GuC submission */
	if (!xe_device_uc_enabled(gt_to_xe(gt)))
		return -ENODEV;
	if (!xe_device_uc_enabled(gt_to_xe(gt))) {
		err = -ENODEV;
		goto err_pm_put;
	}

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

@@ -826,8 +830,6 @@ static int gt_reset(struct xe_gt *gt)
	if (!err)
		xe_gt_warn(gt, "reset block failed to get lifted");

	xe_pm_runtime_get(gt_to_xe(gt));

	if (xe_fault_inject_gt_reset()) {
		err = -ECANCELED;
		goto err_fail;
@@ -874,6 +876,7 @@ static int gt_reset(struct xe_gt *gt)
	xe_gt_err(gt, "reset failed (%pe)\n", ERR_PTR(err));

	xe_device_declare_wedged(gt_to_xe(gt));
err_pm_put:
	xe_pm_runtime_put(gt_to_xe(gt));

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

	xe_gt_info(gt, "reset queued\n");
	queue_work(gt->ordered_wq, &gt->reset.worker);
	xe_pm_runtime_get_noresume(gt_to_xe(gt));
	if (!queue_work(gt->ordered_wq, &gt->reset.worker))
		xe_pm_runtime_put(gt_to_xe(gt));
}

void xe_gt_suspend_prepare(struct xe_gt *gt)
+4 −4
Original line number Diff line number Diff line
@@ -166,10 +166,10 @@ xe_validation_device_init(struct xe_validation_device *val)
 */
DEFINE_CLASS(xe_validation, struct xe_validation_ctx *,
	     if (_T) xe_validation_ctx_fini(_T);,
	     ({_ret = xe_validation_ctx_init(_ctx, _val, _exec, _flags);
	       _ret ? NULL : _ctx; }),
	     ({*_ret = xe_validation_ctx_init(_ctx, _val, _exec, _flags);
	       *_ret ? NULL : _ctx; }),
	     struct xe_validation_ctx *_ctx, struct xe_validation_device *_val,
	     struct drm_exec *_exec, const struct xe_val_flags _flags, int _ret);
	     struct drm_exec *_exec, const struct xe_val_flags _flags, int *_ret);
static inline void *class_xe_validation_lock_ptr(class_xe_validation_t *_T)
{return *_T; }
#define class_xe_validation_is_conditional true
@@ -186,7 +186,7 @@ static inline void *class_xe_validation_lock_ptr(class_xe_validation_t *_T)
 * exhaustive eviction.
 */
#define xe_validation_guard(_ctx, _val, _exec, _flags, _ret)		\
	scoped_guard(xe_validation, _ctx, _val, _exec, _flags, _ret) \
	scoped_guard(xe_validation, _ctx, _val, _exec, _flags, &_ret) \
	drm_exec_until_all_locked(_exec)

#endif