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: <rodrigo.vivi@intel.com>, <dev@lankhorst.se>, <airlied@gmail.com>,
<simona@ffwll.ch>, <kuba@kernel.org>
Subject: Re: [PATCH v3 2/4] drm/xe/drm_ras: Make counter allocation drm managed
Date: Fri, 5 Jun 2026 11:44:34 +0530 [thread overview]
Message-ID: <85f7a34e-aa97-44f0-af85-c8dedc2ead46@intel.com> (raw)
In-Reply-To: <20260602044919.702209-3-raag.jadav@intel.com>
On 6/2/2026 10:18 AM, Raag Jadav wrote:
> cleanup_node_param() is not registered for previous node in case of counter
> allocation failure, which results in stale memory of previous node that
> isn't cleaned up on unwind. Fix this using drm managed allocation, which is
> guaranteed to be cleaned up on unwind.
>
> Fixes: b40db12b542f ("drm/xe/xe_drm_ras: Add support for XE DRM RAS")
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
LGTM
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> ---
> v2: Retain info as NULL on failure (Riana)
> ---
> drivers/gpu/drm/xe/xe_drm_ras.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_drm_ras.c b/drivers/gpu/drm/xe/xe_drm_ras.c
> index c21c8b428de6..c1d5ac198a7c 100644
> --- a/drivers/gpu/drm/xe/xe_drm_ras.c
> +++ b/drivers/gpu/drm/xe/xe_drm_ras.c
> @@ -80,7 +80,7 @@ static struct xe_drm_ras_counter *allocate_and_copy_counters(struct xe_device *x
> struct xe_drm_ras_counter *counter;
> int i;
>
> - counter = kcalloc(DRM_XE_RAS_ERR_COMP_MAX, sizeof(*counter), GFP_KERNEL);
> + counter = drmm_kcalloc(&xe->drm, DRM_XE_RAS_ERR_COMP_MAX, sizeof(*counter), GFP_KERNEL);
> if (!counter)
> return ERR_PTR(-ENOMEM);
>
> @@ -135,7 +135,6 @@ static void cleanup_node_param(struct xe_drm_ras *ras, const enum drm_xe_ras_err
> {
> struct drm_ras_node *node = &ras->node[severity];
>
> - kfree(ras->info[severity]);
> ras->info[severity] = NULL;
>
> kfree(node->device_name);
next prev parent reply other threads:[~2026-06-05 6:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 4:48 [PATCH v3 0/4] DRM RAS Fixes Raag Jadav
2026-06-02 4:48 ` [PATCH v3 1/4] drm/ras: Cancel and free message on get counter failure Raag Jadav
2026-06-02 4:48 ` [PATCH v3 2/4] drm/xe/drm_ras: Make counter allocation drm managed Raag Jadav
2026-06-05 6:14 ` Tauro, Riana [this message]
2026-06-02 4:48 ` [PATCH v3 3/4] drm/xe/drm_ras: Add per node cleanup action Raag Jadav
2026-06-02 4:48 ` [PATCH v3 4/4] drm/xe/hw_error: Use HW_ERR prefix in log 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=85f7a34e-aa97-44f0-af85-c8dedc2ead46@intel.com \
--to=riana.tauro@intel.com \
--cc=airlied@gmail.com \
--cc=dev@lankhorst.se \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raag.jadav@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@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