dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: Linmao Li <lilinmao@kylinos.cn>
Cc: "Ashutosh Dixit" <ashutosh.dixit@intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"José Roberto de Souza" <jose.souza@intel.com>,
	intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/xe/oa: Check managed mutex initialization errors
Date: Tue, 14 Jul 2026 11:15:41 -0700	[thread overview]
Message-ID: <alZ8zR98JSfuSYAx@soc-5CG1426VCC.clients.intel.com> (raw)
In-Reply-To: <20260713083053.321091-1-lilinmao@kylinos.cn>

On Mon, Jul 13, 2026 at 04:30:53PM +0800, Linmao Li wrote:
>drmm_mutex_init() can fail while registering its managed cleanup action.
>On failure, the reset path destroys the mutex, so continuing OA setup
>leaves an unusable lock that later paths may acquire.
>
>Return the error from per-GT OA initialization and abort device-wide OA
>initialization if the metrics lock cannot be initialized.
>
>Fixes: a9f905ae7b6f ("drm/xe/oa/uapi: Initialize OA units")
>Fixes: cdf02fe1a94a ("drm/xe/oa/uapi: Add/remove OA config perf ops")
>Signed-off-by: Linmao Li <lilinmao@kylinos.cn>

Thanks for addressing this. LGTM, 

Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>



>---
> drivers/gpu/drm/xe/xe_oa.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
>index 2dce6a47202c..f3a0d5bf7894 100644
>--- a/drivers/gpu/drm/xe/xe_oa.c
>+++ b/drivers/gpu/drm/xe/xe_oa.c
>@@ -2713,9 +2713,7 @@ static int xe_oa_init_gt(struct xe_gt *gt)
>
> 	__xe_oa_init_oa_units(gt);
>
>-	drmm_mutex_init(&gt_to_xe(gt)->drm, &gt->oa.gt_lock);
>-
>-	return 0;
>+	return drmm_mutex_init(&gt_to_xe(gt)->drm, &gt->oa.gt_lock);
> }
>
> static void xe_oa_print_gt_oa_units(struct xe_gt *gt)
>@@ -2855,7 +2853,10 @@ int xe_oa_init(struct xe_device *xe)
> 	oa->xe = xe;
> 	oa->oa_formats = oa_formats;
>
>-	drmm_mutex_init(&oa->xe->drm, &oa->metrics_lock);
>+	ret = drmm_mutex_init(&oa->xe->drm, &oa->metrics_lock);
>+	if (ret)
>+		goto exit;
>+
> 	idr_init_base(&oa->metrics_idr, 1);
>
> 	ret = xe_oa_init_oa_units(oa);
>-- 
>2.25.1
>

      parent reply	other threads:[~2026-07-14 18:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  8:30 [PATCH] drm/xe/oa: Check managed mutex initialization errors Linmao Li
2026-07-13  8:45 ` sashiko-bot
2026-07-14 18:15 ` Umesh Nerlige Ramappa [this message]

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=alZ8zR98JSfuSYAx@soc-5CG1426VCC.clients.intel.com \
    --to=umesh.nerlige.ramappa@intel.com \
    --cc=airlied@gmail.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    --cc=lilinmao@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.brost@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=thomas.hellstrom@linux.intel.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