drm/amd/pm: fix uninitialized variable warnings for vangogh_ppt
authorjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 09:09:08 +0000 (09:09 +0000)
committerjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 09:09:08 +0000 (09:09 +0000)
From Tim Huang
97667de35ba771ed50430c5541c217c035b37810 in linux-6.6.y/6.6.50
b2871de6961d24d421839fbfa4aa3008ec9170d5 in mainline linux

sys/dev/pci/drm/amd/pm/swsmu/smu11/vangogh_ppt.c

index de368ae..c242656 100644 (file)
@@ -1017,6 +1017,18 @@ static int vangogh_get_dpm_ultimate_freq(struct smu_context *smu,
                }
        }
        if (min) {
+               ret = vangogh_get_profiling_clk_mask(smu,
+                                                    AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK,
+                                                    NULL,
+                                                    NULL,
+                                                    &mclk_mask,
+                                                    &fclk_mask,
+                                                    &soc_mask);
+               if (ret)
+                       goto failed;
+
+               vclk_mask = dclk_mask = 0;
+
                switch (clk_type) {
                case SMU_UCLK:
                case SMU_MCLK:
@@ -2489,6 +2501,8 @@ static u32 vangogh_set_gfxoff_residency(struct smu_context *smu, bool start)
 
        ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_LogGfxOffResidency,
                                              start, &residency);
+       if (ret)
+               return ret;
 
        if (!start)
                adev->gfx.gfx_off_residency = residency;