From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/pcode: Don't ignore drmm_mutex_init failure
Date: Fri, 29 May 2026 20:20:26 -0400 [thread overview]
Message-ID: <ahotSpaaIBPWKksi@intel.com> (raw)
In-Reply-To: <20260529195956.25349-1-michal.wajdeczko@intel.com>
On Fri, May 29, 2026 at 09:59:56PM +0200, Michal Wajdeczko wrote:
> The drm_device-managed mutex_init might fail and return an error.
> Add proper error handling. While around, update the function name
> to clearly indicate this is an early software-only initialization.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_pcode.c | 8 +++++---
> drivers/gpu/drm/xe/xe_pcode.h | 2 +-
> drivers/gpu/drm/xe/xe_tile.c | 4 +++-
> 3 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
> index dc66d0c7ee06..866986694d9c 100644
> --- a/drivers/gpu/drm/xe/xe_pcode.c
> +++ b/drivers/gpu/drm/xe/xe_pcode.c
> @@ -323,15 +323,17 @@ int xe_pcode_ready(struct xe_device *xe, bool locked)
> }
>
> /**
> - * xe_pcode_init: initialize components of PCODE
> + * xe_pcode_init_early() - Initialize components of PCODE
> * @tile: tile instance
> *
> * This function initializes the xe_pcode component.
> * To be called once only during probe.
> + *
> + * Return: 0 on success or a negative error code on failure.
> */
> -void xe_pcode_init(struct xe_tile *tile)
> +int xe_pcode_init_early(struct xe_tile *tile)
> {
> - drmm_mutex_init(&tile_to_xe(tile)->drm, &tile->pcode.lock);
> + return drmm_mutex_init(&tile_to_xe(tile)->drm, &tile->pcode.lock);
> }
>
> /**
> diff --git a/drivers/gpu/drm/xe/xe_pcode.h b/drivers/gpu/drm/xe/xe_pcode.h
> index 490e4f269607..18260c29e620 100644
> --- a/drivers/gpu/drm/xe/xe_pcode.h
> +++ b/drivers/gpu/drm/xe/xe_pcode.h
> @@ -12,7 +12,7 @@ struct drm_device;
> struct xe_device;
> struct xe_tile;
>
> -void xe_pcode_init(struct xe_tile *tile);
> +int xe_pcode_init_early(struct xe_tile *tile);
> int xe_pcode_probe_early(struct xe_device *xe);
> int xe_pcode_ready(struct xe_device *xe, bool locked);
> int xe_pcode_init_min_freq_table(struct xe_tile *tile, u32 min_gt_freq,
> diff --git a/drivers/gpu/drm/xe/xe_tile.c b/drivers/gpu/drm/xe/xe_tile.c
> index c465aae7883c..74d925a337b7 100644
> --- a/drivers/gpu/drm/xe/xe_tile.c
> +++ b/drivers/gpu/drm/xe/xe_tile.c
> @@ -157,7 +157,9 @@ int xe_tile_init_early(struct xe_tile *tile, struct xe_device *xe, u8 id)
> if (err)
> return err;
>
> - xe_pcode_init(tile);
> + err = xe_pcode_init_early(tile);
> + if (err)
> + return err;
>
> return 0;
> }
> --
> 2.47.1
>
next prev parent reply other threads:[~2026-05-30 0:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 19:59 [PATCH] drm/xe/pcode: Don't ignore drmm_mutex_init failure Michal Wajdeczko
2026-05-29 20:58 ` ✓ CI.KUnit: success for " Patchwork
2026-05-29 22:03 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-30 0:20 ` Rodrigo Vivi [this message]
2026-05-30 1:40 ` ✗ Xe.CI.FULL: failure " Patchwork
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=ahotSpaaIBPWKksi@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@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