Re: [PATCH v1] drm/xe/ras: Fix invalid health error code
Michal Wajdeczko <[email protected]> Tue, 4 Aug 2026 08:56:12 +0200
| Newsgroups | org.freedesktop.lists.intel-xe |
|---|---|
| Message-ID | <[email protected]> |
On 8/4/2026 8:36 AM, Tauro, Riana wrote:
>
> On 04-08-2026 10:42, Raag Jadav wrote:
>> We use -EBADMSG for corrupted responses from sysctrl. Fix the error code.
>
> Let's keep it -EIO as it's more appropriate for sysctrl errors and consistent than
>
> #define EBADMSG 74 /* Not a data message */
btw, inside GuC CTB code we use
-EPIPE // for corrupted message/channel
-EPROTO // for unexpected content in the message
as -EIO is too generic
>
> Thanks
> Riana
>
>>
>> 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];