From: Raag Jadav <raag.jadav@intel.com>
To: Riana Tauro <riana.tauro@intel.com>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
netdev@vger.kernel.org, aravind.iddamsetty@linux.intel.com,
anshuman.gupta@intel.com, rodrigo.vivi@intel.com,
joonas.lahtinen@linux.intel.com, simona.vetter@ffwll.ch,
airlied@gmail.com, pratik.bari@intel.com,
joshua.santosh.ranjan@intel.com, ashwin.kumar.kulkarni@intel.com,
shubham.kumar@intel.com, ravi.kishore.koppuravuri@intel.com,
anvesh.bakwad@intel.com, maarten.lankhorst@linux.intel.com
Subject: Re: [PATCH 2/4] drm/xe/xe_drm_ras: Add support for clear-error-counter in XE DRM RAS
Date: Thu, 12 Mar 2026 11:17:30 +0100 [thread overview]
Message-ID: <abKSunbqoLw7uxmd@black.igk.intel.com> (raw)
In-Reply-To: <20260311102913.3387468-8-riana.tauro@intel.com>
On Wed, Mar 11, 2026 at 03:59:16PM +0530, Riana Tauro wrote:
> Add support for clear-error-counter command in XE DRM RAS.
> This resets the counter value.
>
> Usage:
>
> $ sudo ynl --family drm_ras --do clear-error-counter --json \
> '{"node-id":1, "error-id":1}'
> None
>
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> ---
> drivers/gpu/drm/xe/xe_drm_ras.c | 35 +++++++++++++++++++++++++++++++--
> 1 file changed, 33 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_drm_ras.c b/drivers/gpu/drm/xe/xe_drm_ras.c
> index e07dc23a155e..c21c8b428de6 100644
> --- a/drivers/gpu/drm/xe/xe_drm_ras.c
> +++ b/drivers/gpu/drm/xe/xe_drm_ras.c
> @@ -27,6 +27,16 @@ static int hw_query_error_counter(struct xe_drm_ras_counter *info,
> return 0;
> }
>
> +static int hw_clear_error_counter(struct xe_drm_ras_counter *info, u32 error_id)
> +{
> + if (!info || !info[error_id].name)
> + return -ENOENT;
> +
> + atomic_set(&info[error_id].counter, 0);
> +
> + return 0;
> +}
> +
> static int query_uncorrectable_error_counter(struct drm_ras_node *ep, u32 error_id,
> const char **name, u32 *val)
> {
> @@ -37,6 +47,15 @@ static int query_uncorrectable_error_counter(struct drm_ras_node *ep, u32 error_
> return hw_query_error_counter(info, error_id, name, val);
> }
>
> +static int clear_uncorrectable_error_counter(struct drm_ras_node *node, u32 error_id)
> +{
> + struct xe_device *xe = node->priv;
> + struct xe_drm_ras *ras = &xe->ras;
> + struct xe_drm_ras_counter *info = ras->info[DRM_XE_RAS_ERR_SEV_UNCORRECTABLE];
> +
> + return hw_clear_error_counter(info, error_id);
> +}
> +
> static int query_correctable_error_counter(struct drm_ras_node *ep, u32 error_id,
> const char **name, u32 *val)
> {
> @@ -47,6 +66,15 @@ static int query_correctable_error_counter(struct drm_ras_node *ep, u32 error_id
> return hw_query_error_counter(info, error_id, name, val);
> }
>
> +static int clear_correctable_error_counter(struct drm_ras_node *node, u32 error_id)
> +{
> + struct xe_device *xe = node->priv;
> + struct xe_drm_ras *ras = &xe->ras;
> + struct xe_drm_ras_counter *info = ras->info[DRM_XE_RAS_ERR_SEV_CORRECTABLE];
> +
> + return hw_clear_error_counter(info, error_id);
> +}
This would've been much simpler if we had per node info, but for now
Reviewed-by: Raag Jadav <raag.jadav@intel.com>
> static struct xe_drm_ras_counter *allocate_and_copy_counters(struct xe_device *xe)
> {
> struct xe_drm_ras_counter *counter;
> @@ -92,10 +120,13 @@ static int assign_node_params(struct xe_device *xe, struct drm_ras_node *node,
> if (IS_ERR(ras->info[severity]))
> return PTR_ERR(ras->info[severity]);
>
> - if (severity == DRM_XE_RAS_ERR_SEV_CORRECTABLE)
> + if (severity == DRM_XE_RAS_ERR_SEV_CORRECTABLE) {
> node->query_error_counter = query_correctable_error_counter;
> - else
> + node->clear_error_counter = clear_correctable_error_counter;
> + } else {
> node->query_error_counter = query_uncorrectable_error_counter;
> + node->clear_error_counter = clear_uncorrectable_error_counter;
> + }
>
> return 0;
> }
> --
> 2.47.1
>
next prev parent reply other threads:[~2026-03-12 10:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 10:29 [PATCH 0/4] Add support for clear counter and error event in DRM RAS Riana Tauro
2026-03-11 10:29 ` [PATCH 1/4] drm/drm_ras: Add clear-error-counter netlink command to drm_ras Riana Tauro
2026-03-12 0:29 ` Jakub Kicinski
2026-03-25 12:40 ` Raag Jadav
2026-03-11 10:29 ` [PATCH 2/4] drm/xe/xe_drm_ras: Add support for clear-error-counter in XE DRM RAS Riana Tauro
2026-03-12 10:17 ` Raag Jadav [this message]
2026-03-11 10:29 ` [PATCH 3/4] drm/drm_ras: Add DRM RAS netlink error event notification Riana Tauro
2026-03-25 13:31 ` Raag Jadav
2026-03-11 10:29 ` [PATCH 4/4] drm/xe/xe_drm_ras: Add error-event support in XE DRM RAS Riana Tauro
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=abKSunbqoLw7uxmd@black.igk.intel.com \
--to=raag.jadav@intel.com \
--cc=airlied@gmail.com \
--cc=anshuman.gupta@intel.com \
--cc=anvesh.bakwad@intel.com \
--cc=aravind.iddamsetty@linux.intel.com \
--cc=ashwin.kumar.kulkarni@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=joshua.santosh.ranjan@intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pratik.bari@intel.com \
--cc=ravi.kishore.koppuravuri@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=shubham.kumar@intel.com \
--cc=simona.vetter@ffwll.ch \
/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