]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/xe/guc: Add some failure checks
authorVinay Belgaumkar <vinay.belgaumkar@intel.com>
Thu, 21 Mar 2024 19:12:19 +0000 (12:12 -0700)
committerDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Fri, 22 Mar 2024 17:22:08 +0000 (10:22 -0700)
Return failures from pc_adjust_freq_bounds.

Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240321191219.243583-1-vinay.belgaumkar@intel.com
drivers/gpu/drm/xe/xe_guc_pc.c

index 786acaf719314cb9969192037d8012845a7c7524..b242af8ed59f1879f83c996119d829aca629e582 100644 (file)
@@ -714,24 +714,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)