Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/guc: Add some failure checks
@ 2024-03-21 19:12 Vinay Belgaumkar
  2024-03-21 19:48 ` Rodrigo Vivi
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Vinay Belgaumkar @ 2024-03-21 19:12 UTC (permalink / raw)
  To: intel-xe; +Cc: Vinay Belgaumkar

Return failures from pc_adjust_freq_bounds.

Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-21 22:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-21 19:12 [PATCH] drm/xe/guc: Add some failure checks Vinay Belgaumkar
2024-03-21 19:48 ` Rodrigo Vivi
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox