Re: [PATCH v1] drm/xe/drm_ras: Move has_drm_ras check to drm_ras layer

Michal Wajdeczko <[email protected]> Mon, 3 Aug 2026 11:03:11 +0200
Newsgroups org.freedesktop.lists.intel-xe
Message-ID <[email protected]>

On 8/3/2026 10:08 AM, Raag Jadav wrote:
> has_drm_ras flag is meant to facilitate drm_ras feature. Move it to the
> correct layer where it belogs.

typo: belongs

> 
> Fixes: 63dfab5786ca ("drm/xe/xe_ras: Add drm_ras feature flag")
> Signed-off-by: Raag Jadav <[email protected]>
> ---
>  drivers/gpu/drm/xe/xe_drm_ras.c | 3 +++
>  drivers/gpu/drm/xe/xe_ras.c     | 3 ---
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_drm_ras.c b/drivers/gpu/drm/xe/xe_drm_ras.c
> index 4afa2ad98300..a23cfb49361b 100644
> --- a/drivers/gpu/drm/xe/xe_drm_ras.c
> +++ b/drivers/gpu/drm/xe/xe_drm_ras.c
> @@ -233,6 +233,9 @@ int xe_drm_ras_init(struct xe_device *xe)
>  	struct drm_ras_node *node;
>  	int err;
>  
> +	if (!xe->info.has_drm_ras)
> +		return 0;
> +
>  	node = drmm_kcalloc(&xe->drm, DRM_XE_RAS_ERR_SEV_MAX, sizeof(*node), GFP_KERNEL);
>  	if (!node)
>  		return -ENOMEM;
> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 28123f08e513..f7af4da8172c 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -816,9 +816,6 @@ void xe_ras_init(struct xe_device *xe)
>  {
>  	int ret;
>  
> -	if (!xe->info.has_drm_ras)
> -		return;
> -
>  	xe_drm_ras_init(xe);

btw, shouldn't we handle xe_drm_ras_init() errors here?

hmm, and it looks that xe_ras_init() ignores all errors,
which is kind of against the "all-or-nothing" driver rule

(but this is not as something to fix in this patch)

>  
>  	if (!xe->info.has_sysctrl)