On 10/3/2021 10:16 AM, Darren Powell wrote:
Code appears to initialize values but macro will exit without error
or initializing value if function is not implmented

Signed-off-by: Darren Powell <darren.pow...@amd.com>
---
  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c 
b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index faa78a048b1f..210f047e136d 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -712,6 +712,10 @@ static int smu_late_init(void *handle)
                return ret;
        }
+ smu->current_power_limit = 0;
+       smu->default_power_limit = 0;
+       smu->max_power_limit = 0;
+

If this is only about first-time init - smu_context is part of adev, it will be zero initialized when adev is allocated.


Thanks,
Lijo

        ret = smu_get_asic_power_limits(smu,
                                        &smu->current_power_limit,
                                        &smu->default_power_limit,

Reply via email to