Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/guc: Add some failure checks
Date: Thu, 21 Mar 2024 15:48:53 -0400	[thread overview]
Message-ID: <ZfyPJYzIz22_SWs9@intel.com> (raw)
In-Reply-To: <20240321191219.243583-1-vinay.belgaumkar@intel.com>

On Thu, Mar 21, 2024 at 12:12:19PM -0700, Vinay Belgaumkar wrote:
> Return failures from pc_adjust_freq_bounds.
> 
> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_guc_pc.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
> index 6dfae1c23946..9c110537d135 100644
> --- a/drivers/gpu/drm/xe/xe_guc_pc.c
> +++ b/drivers/gpu/drm/xe/xe_guc_pc.c
> @@ -695,24 +695,28 @@ static int pc_adjust_freq_bounds(struct xe_guc_pc *pc)
>  
>  	ret = pc_action_query_task_state(pc);
>  	if (ret)
> -		return ret;
> +		goto out;
>  
>  	/*
>  	 * GuC defaults to some RPmax that is not actually achievable without
>  	 * overclocking. Let's adjust it to the Hardware RP0, which is the
>  	 * regular maximum
>  	 */
> -	if (pc_get_max_freq(pc) > pc->rp0_freq)
> -		pc_set_max_freq(pc, pc->rp0_freq);
> +	if (pc_get_max_freq(pc) > pc->rp0_freq) {
> +		ret = pc_set_max_freq(pc, pc->rp0_freq);
> +		if (ret)
> +			goto out;
> +	}
>  
>  	/*
>  	 * Same thing happens for Server platforms where min is listed as
>  	 * RPMax
>  	 */
>  	if (pc_get_min_freq(pc) > pc->rp0_freq)
> -		pc_set_min_freq(pc, pc->rp0_freq);
> +		ret = pc_set_min_freq(pc, pc->rp0_freq);
>  
> -	return 0;
> +out:
> +	return ret;
>  }
>  
>  static int pc_adjust_requested_freq(struct xe_guc_pc *pc)
> -- 
> 2.38.1
> 

  reply	other threads:[~2024-03-21 19:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 19:12 [PATCH] drm/xe/guc: Add some failure checks Vinay Belgaumkar
2024-03-21 19:48 ` Rodrigo Vivi [this message]
2024-03-21 21:43 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-21 21:43 ` ✓ CI.checkpatch: " Patchwork
2024-03-21 21:44 ` ✓ CI.KUnit: " Patchwork
2024-03-21 21:55 ` ✓ CI.Build: " Patchwork
2024-03-21 21:58 ` ✓ CI.Hooks: " Patchwork
2024-03-21 21:59 ` ✓ CI.checksparse: " Patchwork
2024-03-21 22:24 ` ✓ CI.BAT: " 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=ZfyPJYzIz22_SWs9@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=vinay.belgaumkar@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