Netdev List
 help / color / mirror / Atom feed
From: "Tauro, Riana" <riana.tauro@intel.com>
To: Raag Jadav <raag.jadav@intel.com>,
	<intel-xe@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>, <netdev@vger.kernel.org>
Cc: <simona.vetter@ffwll.ch>, <airlied@gmail.com>, <kuba@kernel.org>,
	<lijo.lazar@amd.com>, <Hawking.Zhang@amd.com>,
	<davem@davemloft.net>, <pabeni@redhat.com>, <edumazet@google.com>,
	<maarten@lankhorst.se>, <zachary.mckevitt@oss.qualcomm.com>,
	<rodrigo.vivi@intel.com>, <michal.wajdeczko@intel.com>,
	<matthew.d.roper@intel.com>, <umesh.nerlige.ramappa@intel.com>,
	<mallesh.koujalagi@intel.com>, <anoop.c.vijay@intel.com>,
	<aravind.iddamsetty@linux.intel.com>
Subject: Re: [PATCH v2 7/9] drm/xe/drm_ras: Wire up error threshold callbacks
Date: Wed, 27 May 2026 11:27:48 +0530	[thread overview]
Message-ID: <4fb26efe-b144-4030-8bcd-05a5bb90fe59@intel.com> (raw)
In-Reply-To: <20260512191610.1817578-8-raag.jadav@intel.com>


On 5/13/2026 12:46 AM, Raag Jadav wrote:
> Now that we have get/set error threshold support in xe driver, wire them
> up to drm_ras so that userspace can make use of the functionality.
>
> $ sudo ynl --family drm_ras --do get-error-threshold \
> --json '{"node-id":0, "error-id":2}'
> {'error-id': 2, 'error-name': 'soc-internal', 'error-threshold': 16}
>
> $ sudo ynl --family drm_ras --do set-error-threshold \
> --json '{"node-id":0, "error-id":2, "error-threshold":8}'
> None
>
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_drm_ras.c | 27 +++++++++++++++++++++++++++
>   1 file changed, 27 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_drm_ras.c b/drivers/gpu/drm/xe/xe_drm_ras.c
> index c21c8b428de6..31780d8af7e9 100644
> --- a/drivers/gpu/drm/xe/xe_drm_ras.c
> +++ b/drivers/gpu/drm/xe/xe_drm_ras.c
> @@ -11,6 +11,7 @@
>   
>   #include "xe_device_types.h"
>   #include "xe_drm_ras.h"
> +#include "xe_ras.h"
>   
>   static const char * const error_components[] = DRM_XE_RAS_ERROR_COMPONENT_NAMES;
>   static const char * const error_severity[] = DRM_XE_RAS_ERROR_SEVERITY_NAMES;
> @@ -75,6 +76,30 @@ static int clear_correctable_error_counter(struct drm_ras_node *node, u32 error_
>   	return hw_clear_error_counter(info, error_id);
>   }
>   
> +static int query_correctable_error_threshold(struct drm_ras_node *ep, u32 error_id,
> +					     const char **name, u32 *val)
> +{
> +	struct xe_device *xe = ep->priv;
> +	struct xe_drm_ras *ras = &xe->ras;
> +	struct xe_drm_ras_counter *info = ras->info[DRM_XE_RAS_ERR_SEV_CORRECTABLE];
> +
> +	if (!xe->info.has_sysctrl)
> +		return -EOPNOTSUPP;
> +
> +	*name = info[error_id].name;

Please check if name is null and return -ENOENT.

Thanks
Riana

> +	return xe_ras_get_threshold(xe, DRM_XE_RAS_ERR_SEV_CORRECTABLE, error_id, val);
> +}
> +
> +static int set_correctable_error_threshold(struct drm_ras_node *ep, u32 error_id, u32 val)
> +{
> +	struct xe_device *xe = ep->priv;
> +
> +	if (!xe->info.has_sysctrl)
> +		return -EOPNOTSUPP;
> +
> +	return xe_ras_set_threshold(xe, DRM_XE_RAS_ERR_SEV_CORRECTABLE, error_id, val);
> +}
> +
>   static struct xe_drm_ras_counter *allocate_and_copy_counters(struct xe_device *xe)
>   {
>   	struct xe_drm_ras_counter *counter;
> @@ -123,6 +148,8 @@ static int assign_node_params(struct xe_device *xe, struct drm_ras_node *node,
>   	if (severity == DRM_XE_RAS_ERR_SEV_CORRECTABLE) {
>   		node->query_error_counter = query_correctable_error_counter;
>   		node->clear_error_counter = clear_correctable_error_counter;
> +		node->query_error_threshold = query_correctable_error_threshold;
> +		node->set_error_threshold = set_correctable_error_threshold;
>   	} else {
>   		node->query_error_counter = query_uncorrectable_error_counter;
>   		node->clear_error_counter = clear_uncorrectable_error_counter;

  reply	other threads:[~2026-05-27  5:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 19:16 [PATCH v2 0/9] Introduce error threshold to drm_ras Raag Jadav
2026-05-12 19:16 ` [PATCH v2 1/9] drm/ras: Update counter helpers with counter naming Raag Jadav
2026-05-12 20:49   ` Rodrigo Vivi
2026-05-12 19:16 ` [PATCH v2 2/9] drm/ras: Introduce get-error-threshold Raag Jadav
2026-05-27  6:17   ` Tauro, Riana
2026-05-12 19:16 ` [PATCH v2 3/9] drm/ras: Introduce set-error-threshold Raag Jadav
2026-05-27  6:25   ` Tauro, Riana
2026-05-12 19:16 ` [PATCH v2 4/9] drm/xe/uapi: Add additional error components to xe drm_ras Raag Jadav
2026-05-12 19:16 ` [PATCH v2 5/9] drm/xe/ras: Get error threshold support Raag Jadav
2026-05-12 19:16 ` [PATCH v2 6/9] drm/xe/ras: Set " Raag Jadav
2026-05-27  5:48   ` Tauro, Riana
2026-05-12 19:16 ` [PATCH v2 7/9] drm/xe/drm_ras: Wire up error threshold callbacks Raag Jadav
2026-05-27  5:57   ` Tauro, Riana [this message]
2026-05-12 19:16 ` [PATCH v2 8/9] drm/xe/xe_ras: Move xe drm_ras registration Raag Jadav
2026-05-12 19:16 ` [PATCH v2 9/9] drm/xe/xe_ras: Control xe drm_ras registration with a flag Raag Jadav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4fb26efe-b144-4030-8bcd-05a5bb90fe59@intel.com \
    --to=riana.tauro@intel.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=airlied@gmail.com \
    --cc=anoop.c.vijay@intel.com \
    --cc=aravind.iddamsetty@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=edumazet@google.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=kuba@kernel.org \
    --cc=lijo.lazar@amd.com \
    --cc=maarten@lankhorst.se \
    --cc=mallesh.koujalagi@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=raag.jadav@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona.vetter@ffwll.ch \
    --cc=umesh.nerlige.ramappa@intel.com \
    --cc=zachary.mckevitt@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox