]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe: Update wedged.mode only after successful reset policy change
authorLukasz Laguna <lukasz.laguna@intel.com>
Wed, 7 Jan 2026 17:47:39 +0000 (18:47 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 8 Jan 2026 21:07:42 +0000 (16:07 -0500)
commit0f13dead4e0385859f5c9c3625a19df116b389d3
treef8e23945f7a4a15e48871814f27df0ab48facef5
parent17d3c3365ba9e52596855d6acb71c3159be1b9c3
drm/xe: Update wedged.mode only after successful reset policy change

Previously, the driver's internal wedged.mode state was updated without
verifying whether the corresponding engine reset policy update in GuC
succeeded. This could leave the driver reporting a wedged.mode state
that doesn't match the actual reset behavior programmed in GuC.

With this change, the reset policy is updated first, and the driver's
wedged.mode state is modified only if the policy update succeeds on all
available GTs.

This patch also introduces two functional improvements:

 - The policy is sent to GuC only when a change is required. An update
   is needed only when entering or leaving XE_WEDGED_MODE_UPON_ANY_HANG,
   because only in that case the reset policy changes. For example,
   switching between XE_WEDGED_MODE_UPON_CRITICAL_ERROR and
   XE_WEDGED_MODE_NEVER doesn't affect the reset policy, so there is no
   need to send the same value to GuC.

 - An inconsistent_reset flag is added to track cases where reset policy
   update succeeds only on a subset of GTs. If such inconsistency is
   detected, future wedged mode configuration will force a retry of the
   reset policy update to restore a consistent state across all GTs.

Fixes: 6b8ef44cc0a9 ("drm/xe: Introduce the wedged_mode debugfs")
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
Link: https://patch.msgid.link/20260107174741.29163-3-lukasz.laguna@intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_debugfs.c
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_guc_ads.c
drivers/gpu/drm/xe/xe_guc_ads.h