]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/amdgpu/swsmu: init the baco mutex in early_init
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 12 Oct 2020 14:12:28 +0000 (10:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Oct 2020 19:26:32 +0000 (15:26 -0400)
GPU reset might get called during init time, before
sw_init has been called.

Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index e41fd6ea64518fc7db8cc27ab244469d201bced0..b1e5ec01527b82d7035ba705fe5b1ad4de4188c0 100644 (file)
@@ -417,6 +417,9 @@ static int smu_early_init(void *handle)
        smu->pm_enabled = !!amdgpu_dpm;
        smu->is_apu = false;
        mutex_init(&smu->mutex);
+       mutex_init(&smu->smu_baco.mutex);
+       smu->smu_baco.state = SMU_BACO_STATE_EXIT;
+       smu->smu_baco.platform_support = false;
 
        return smu_set_funcs(adev);
 }
@@ -795,10 +798,6 @@ static int smu_sw_init(void *handle)
        bitmap_zero(smu->smu_feature.enabled, SMU_FEATURE_MAX);
        bitmap_zero(smu->smu_feature.allowed, SMU_FEATURE_MAX);
 
-       mutex_init(&smu->smu_baco.mutex);
-       smu->smu_baco.state = SMU_BACO_STATE_EXIT;
-       smu->smu_baco.platform_support = false;
-
        mutex_init(&smu->sensor_lock);
        mutex_init(&smu->metrics_lock);
        mutex_init(&smu->message_lock);