Re: [PATCH 5/5] drm/xe/xe_ras: Add support to query error counter for CRI

Raag Jadav
2026-04-01T08:08:57Z

On Fri, Mar 20, 2026 at 03:56:00PM +0530, Riana Tauro wrote:
> Add support to query error counter for all errors.
>
> When userspace queries a DRM RAS error counter, fetch the
> latest value from system controller.
>
> Integrate this with XE DRM RAS.
>
> Example : query the counters using ynl

Either Usage or Example, let keep it consistent with other series.

> List all supported errors
>
> $ sudo ynl --family drm_ras --dump get-error-counter \
> --json '{"node-id":1}'
> [{"error-id": 1, "error-name": "core-compute", "error-value": 0},
> {"error-id": 2, "error-name": "soc-internal", "error-value": 0},
> {"error-id": 3, "error-name": "device-memory", "error-value": 0},
> {"error-id": 4, "error-name": "pcie", "error-value": 0},
> {"error-id": 5, "error-name": "fabric", "error-value": 0},]

I haven't tried this but do we really get the last comma in output?

...

> +/**
> + * xe_ras_get_error_counter() - Get error counter value
> + * @xe: xe device instance
> + * @severity: Error severity level to be queried
> + * @error_id: Error component to be queried
> + * @value: Counter value
> + *
> + * This function retrieves the value of a specific RAS error counter based on
> + * the provided severity and component.
> + *
> + * Return: 0 on success, negative error code on failure.
> + */
> +int xe_ras_get_error_counter(struct xe_device *xe, const enum drm_xe_ras_error_severity severity,
> + u32 error_id, u32 *value)

For event cases we need to reuse this based on error class we read,
perhaps keep a provision for it?

Raag