[PATCH v1] drm/xe/ras: Fix invalid health error code

Raag Jadav <[email protected]> Tue, 4 Aug 2026 10:42:14 +0530
Newsgroups org.freedesktop.lists.intel-xe
Message-ID <[email protected]>
We use -EBADMSG for corrupted responses from sysctrl. Fix the error code.

Fixes: 53a7115f9862 ("drm/xe/xe_ras: Add RAS GPU health indicator")
Signed-off-by: Raag Jadav <[email protected]>
---
 drivers/gpu/drm/xe/xe_ras.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index f7af4da8172c..bdad0621ae12 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -700,7 +700,7 @@ static ssize_t gpu_health_show(struct device *dev, struct device_attribute *attr
 	if (response.health >= XE_RAS_HEALTH_MAX) {
 		xe_err(xe, "sysctrl: invalid health state %u\n",
 		       response.health);
-		return -EIO;
+		return -EBADMSG;
 	}
 
 	health = gpu_health_states[response.health];
@@ -753,7 +753,7 @@ static ssize_t gpu_health_store(struct device *dev, struct device_attribute *att
 	if (response.health >= XE_RAS_HEALTH_MAX) {
 		xe_err(xe, "sysctrl: invalid health state %u\n",
 		       response.health);
-		return -EIO;
+		return -EBADMSG;
 	}
 
 	health = gpu_health_states[response.health];
-- 
2.43.0