From: Mario Limonciello <mario.limonciello@amd.com>
To: "Sunil Khatri" <sunil.khatri@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Validate return value of pm_runtime_get_sync
Date: Tue, 4 Mar 2025 11:57:00 -0600 [thread overview]
Message-ID: <52638c55-ba64-4cf0-9bf3-8b7935e42f3e@amd.com> (raw)
In-Reply-To: <20250304175128.368511-1-sunil.khatri@amd.com>
On 3/4/2025 11:51, Sunil Khatri wrote:
> An invalid return value 'r' of the pm_runtime_get_sync
> is r < 0 so fix the return value and add proper logging
> of failure and exit cleanly.
You have an extra space between "failure" and "and".
>
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
> index 3a71d01b54c9..6babadeec268 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
> @@ -289,8 +289,11 @@ static int mes_userq_mqd_create(struct amdgpu_userq_mgr *uq_mgr,
> queue->userq_prop = userq_props;
>
> r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
> - if (r)
> + if (r < 0) {
> + DRM_ERROR("Failed to increment ref count of device pm_runtime \n");
For new code can you please use drm_err() instead of DRM_ERROR()?
> + pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
> goto free_mqd;
> + }
>
> r = mqd_hw_default->init_mqd(adev, (void *)queue->mqd.cpu_ptr, userq_props);
> if (r) {
next prev parent reply other threads:[~2025-03-04 17:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 17:51 [PATCH] drm/amdgpu: Validate return value of pm_runtime_get_sync Sunil Khatri
2025-03-04 17:57 ` Mario Limonciello [this message]
2025-03-04 18:03 ` Khatri, Sunil
2025-03-04 18:05 ` Mario Limonciello
2025-03-04 18:25 ` Alex Deucher
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=52638c55-ba64-4cf0-9bf3-8b7935e42f3e@amd.com \
--to=mario.limonciello@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=sunil.khatri@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.