Skip to content

Commit

Permalink
drm/amdgpu/smu: add metrics table lock
Browse files Browse the repository at this point in the history
This table is used for lots of things, add it's own lock.

Bug: https://gitlab.freedesktop.org/drm/amd/issues/900
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Alex Deucher committed Dec 29, 2019
1 parent 5d30ed3 commit 073d5ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ static int smu_sw_init(void *handle)
smu->smu_baco.platform_support = false;

mutex_init(&smu->sensor_lock);
mutex_init(&smu->metrics_lock);

smu->watermarks_bitmap = 0;
smu->power_profile_mode = PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ struct smu_context
const struct pptable_funcs *ppt_funcs;
struct mutex mutex;
struct mutex sensor_lock;
struct mutex metrics_lock;
uint64_t pool_size;

struct smu_table_context smu_table;
Expand Down

0 comments on commit 073d5ee

Please sign in to comment.