From: Matthew Brost <matthew.brost@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-xe@lists.freedesktop.org, Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-xe] [PATCH 1/2] drm/xe: Fix error path in xe_guc_pc_gucrc_disable()
Date: Fri, 4 Aug 2023 00:29:00 +0000 [thread overview]
Message-ID: <ZMxGTIEXnbHhRYH4@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20230803234209.881924-1-lucas.demarchi@intel.com>
On Thu, Aug 03, 2023 at 04:42:08PM -0700, Lucas De Marchi wrote:
> Make sure to always call xe_device_mem_access_put(), even on error.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_pc.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
> index 91a3967fd799..19d743f92f43 100644
> --- a/drivers/gpu/drm/xe/xe_guc_pc.c
> +++ b/drivers/gpu/drm/xe/xe_guc_pc.c
> @@ -745,25 +745,27 @@ static int pc_adjust_requested_freq(struct xe_guc_pc *pc)
> int xe_guc_pc_gucrc_disable(struct xe_guc_pc *pc)
> {
> struct xe_gt *gt = pc_to_gt(pc);
> - int ret;
> + int ret = 0;
>
> xe_device_mem_access_get(pc_to_xe(pc));
>
> ret = pc_action_setup_gucrc(pc, XE_GUCRC_HOST_CONTROL);
> if (ret)
> - return ret;
> + goto out;
>
> ret = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
> if (ret)
> - return ret;
> + goto out;
>
> xe_mmio_write32(gt, PG_ENABLE, 0);
> xe_mmio_write32(gt, RC_CONTROL, 0);
> xe_mmio_write32(gt, RC_STATE, 0);
>
> XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
> +
> +out:
> xe_device_mem_access_put(pc_to_xe(pc));
> - return 0;
> + return ret;
> }
>
> static void pc_init_pcode_freq(struct xe_guc_pc *pc)
> --
> 2.40.1
>
next prev parent reply other threads:[~2023-08-04 0:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-03 23:42 [Intel-xe] [PATCH 1/2] drm/xe: Fix error path in xe_guc_pc_gucrc_disable() Lucas De Marchi
2023-08-03 23:42 ` [Intel-xe] [PATCH 2/2] drm/xe: Fix error path in xe_guc_pc_start() Lucas De Marchi
2023-08-04 0:27 ` Matthew Brost
2023-08-03 23:44 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe: Fix error path in xe_guc_pc_gucrc_disable() Patchwork
2023-08-03 23:44 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-03 23:45 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-03 23:49 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-03 23:49 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-08-03 23:50 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-04 0:29 ` Matthew Brost [this message]
2023-08-04 7:43 ` [Intel-xe] ○ CI.BAT: info " 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=ZMxGTIEXnbHhRYH4@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=rodrigo.vivi@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