From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Shuicheng Lin <shuicheng.lin@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/debugfs: Add missing xe_pm_runtime_put in wedge_mode_set
Date: Thu, 13 Feb 2025 18:22:30 -0500 [thread overview]
Message-ID: <Z65-tkdKpqzH2gMg@intel.com> (raw)
In-Reply-To: <20250213230322.1180621-1-shuicheng.lin@intel.com>
On Thu, Feb 13, 2025 at 11:03:22PM +0000, Shuicheng Lin wrote:
> xe_pm_runtime_put is missed in the failure path.
>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
> ---
> drivers/gpu/drm/xe/xe_debugfs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
> index 56cb3788e752..761e00cb6437 100644
> --- a/drivers/gpu/drm/xe/xe_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_debugfs.c
> @@ -176,6 +176,7 @@ static ssize_t wedged_mode_set(struct file *f, const char __user *ubuf,
> ret = xe_guc_ads_scheduler_policy_toggle_reset(>->uc.guc.ads);
> if (ret) {
> xe_gt_err(gt, "Failed to update GuC ADS scheduler policy. GuC may still cause engine reset even with wedged_mode=2\n");
> + xe_pm_runtime_put(xe);
to ensure a git-grep alignment in the balance we try to use goto
in cases like this...
so it would be something like
ssize_t ret = size;
- return -EIO;
+ ret = -EIO;
+ goto out;
+out
xe_pm_runtime_put(xe);
- return size;
+ return ret;
But well, the code itself is right and better to protect.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
just let me know if you are taking the goto approach or if I should
get this one merged.
Thanks,
Rodrigo.
> return -EIO;
> }
> }
> --
> 2.25.1
>
next prev parent reply other threads:[~2025-02-13 23:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 23:03 [PATCH] drm/xe/debugfs: Add missing xe_pm_runtime_put in wedge_mode_set Shuicheng Lin
2025-02-13 23:22 ` Rodrigo Vivi [this message]
2025-02-14 2:12 ` Lin, Shuicheng
2025-02-14 15:10 ` Rodrigo Vivi
2025-02-14 1:20 ` ✓ CI.Patch_applied: success for " Patchwork
2025-02-14 1:21 ` ✓ CI.checkpatch: " Patchwork
2025-02-14 1:22 ` ✓ CI.KUnit: " Patchwork
2025-02-14 1:38 ` ✓ CI.Build: " Patchwork
2025-02-14 1:40 ` ✓ CI.Hooks: " Patchwork
2025-02-14 1:42 ` ✓ CI.checksparse: " Patchwork
2025-02-14 2:01 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-14 23:42 ` ✗ 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=Z65-tkdKpqzH2gMg@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=shuicheng.lin@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