Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] drm/xe/xe_ras: Skip gpu_health sysfs commands when wedged
@ 2026-11-25  8:56 Ravi Kishore Koppuravuri
  2026-11-25  9:02 ` sashiko-bot
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ravi Kishore Koppuravuri @ 2026-11-25  8:56 UTC (permalink / raw)
  To: intel-xe
  Cc: soham.purkait, riana.tauro, raag.jadav, anshuman.gupta,
	mallesh.koujalagi, Ravi Kishore Koppuravuri

Accessing the gpu_health sysfs attribute sends a command to the system
controller. Add a guard to skip the command when the device is wedged
and not in XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET mode.

Signed-off-by: Ravi Kishore Koppuravuri <ravi.kishore.koppuravuri@intel.com>
Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
---
V3: 
  - Replaced the wedge mode no reset condition with xe_wedge_mode_is_no_reset()
    in the guard
V2:
  - Added support for not skipping when wedged in
    XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET mode (Riana)
  - Removed xe_device_is_in_reset() from the guard (Riana)
  - Removed log message from the guard (sashiko, Mallesh and Riana)
---
 drivers/gpu/drm/xe/xe_ras.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index 9b04be3405ca..0c3238cbe446 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -1298,6 +1298,9 @@ static ssize_t gpu_health_show(struct device *dev, struct device_attribute *attr
 	size_t rlen;
 	int ret;
 
+	if (xe_wedged(xe) && !xe_wedge_mode_is_no_reset(xe))
+		return -ECANCELED;
+
 	xe_sysctrl_create_command(&command, XE_SYSCTRL_GROUP_GFSP, XE_SYSCTRL_CMD_GET_HEALTH,
 				  &request, sizeof(request), &response, sizeof(response));
 	guard(xe_pm_runtime)(xe);
@@ -1341,6 +1344,9 @@ static ssize_t gpu_health_store(struct device *dev, struct device_attribute *att
 	if (state < 0)
 		return -EINVAL;
 
+	if (xe_wedged(xe) && !xe_wedge_mode_is_no_reset(xe))
+		return -ECANCELED;
+
 	request.health = state;
 
 	xe_sysctrl_create_command(&command, XE_SYSCTRL_GROUP_GFSP, XE_SYSCTRL_CMD_SET_HEALTH,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-25 11:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25  8:56 [PATCH v4] drm/xe/xe_ras: Skip gpu_health sysfs commands when wedged Ravi Kishore Koppuravuri
2026-11-25  9:02 ` sashiko-bot
2026-11-25  9:06 ` ✓ CI.KUnit: success for " Patchwork
2026-11-25  9:44 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-25 11:27 ` ✓ Xe.CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox