From: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/guc: Check error code when initializing the CT mutex
Date: Fri, 22 Mar 2024 10:00:07 -0700 [thread overview]
Message-ID: <e0bad66b-2234-45a0-bdac-df7457b9f9b3@intel.com> (raw)
In-Reply-To: <20240321195512.274210-1-daniele.ceraolospurio@intel.com>
On 3/21/2024 12:55 PM, Daniele Ceraolo Spurio wrote:
> The initialization via drmm_mutex_init can fail, so we need to check the
> return code and escalate the failure.
>
> The mutex initialization has been moved after all the other init steps
> that can't fail, so we're always guaranteed to have those done and don't
> have to check in the cleanup code.
>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_ct.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
> index d9fa81900ff5..1d930a8eeeca 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -145,13 +145,16 @@ int xe_guc_ct_init(struct xe_guc_ct *ct)
>
> xe_assert(xe, !(guc_ct_size() % PAGE_SIZE));
>
> - drmm_mutex_init(&xe->drm, &ct->lock);
> spin_lock_init(&ct->fast_lock);
> xa_init(&ct->fence_lookup);
> INIT_WORK(&ct->g2h_worker, g2h_worker_func);
> init_waitqueue_head(&ct->wq);
> init_waitqueue_head(&ct->g2h_fence_wq);
>
> + err = drmm_mutex_init(&xe->drm, &ct->lock);
> + if (err)
> + return err;
> +
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
> primelockdep(ct);
>
> bo = xe_managed_bo_create_pin_map(xe, tile, guc_ct_size(),
prev parent reply other threads:[~2024-03-22 17:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 19:55 [PATCH] drm/xe/guc: Check error code when initializing the CT mutex Daniele Ceraolo Spurio
2024-03-21 22:29 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-21 22:29 ` ✓ CI.checkpatch: " Patchwork
2024-03-21 22:30 ` ✓ CI.KUnit: " Patchwork
2024-03-21 22:41 ` ✓ CI.Build: " Patchwork
2024-03-21 22:43 ` ✓ CI.Hooks: " Patchwork
2024-03-21 22:45 ` ✓ CI.checksparse: " Patchwork
2024-03-21 23:08 ` ✓ CI.BAT: " Patchwork
2024-03-22 17:00 ` Belgaumkar, Vinay [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=e0bad66b-2234-45a0-bdac-df7457b9f9b3@intel.com \
--to=vinay.belgaumkar@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/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