* [PATCH] drm/amdgpu/swsmu: init the baco mutex in early_init
@ 2020-10-13 12:14 Alex Deucher
2020-10-13 12:37 ` Wang, Kevin(Yang)
0 siblings, 1 reply; 2+ messages in thread
From: Alex Deucher @ 2020-10-13 12:14 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
GPU reset might get called during init time, before
sw_init has been called.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index f78749bc8760..7e1b303b5a3f 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -422,6 +422,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);
}
@@ -803,10 +806,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);
--
2.25.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amdgpu/swsmu: init the baco mutex in early_init
2020-10-13 12:14 [PATCH] drm/amdgpu/swsmu: init the baco mutex in early_init Alex Deucher
@ 2020-10-13 12:37 ` Wang, Kevin(Yang)
0 siblings, 0 replies; 2+ messages in thread
From: Wang, Kevin(Yang) @ 2020-10-13 12:37 UTC (permalink / raw)
To: Alex Deucher; +Cc: Deucher, Alexander, amd-gfx
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
> 在 2020年10月13日,20:15,Alex Deucher <alexdeucher@gmail.com> 写道:
>
> GPU reset might get called during init time, before
> sw_init has been called.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index f78749bc8760..7e1b303b5a3f 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -422,6 +422,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);
> }
> @@ -803,10 +806,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);
> --
> 2.25.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-13 12:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 12:14 [PATCH] drm/amdgpu/swsmu: init the baco mutex in early_init Alex Deucher
2020-10-13 12:37 ` Wang, Kevin(Yang)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).