Commit 56383e8f authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/pm: drop unneeded smu->sensor_lock

As all those related APIs are already well protected by
adev->pm.mutex and smu->message_lock.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarGuchun Chen <guchun.chen@amd.com>
Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent da11407f
......@@ -955,7 +955,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->sensor_lock);
mutex_init(&smu->message_lock);
INIT_WORK(&smu->throttling_logging_work, smu_throttling_logging_work_fn);
......
......@@ -486,7 +486,6 @@ struct smu_context
const struct cmn2asic_mapping *table_map;
const struct cmn2asic_mapping *pwr_src_map;
const struct cmn2asic_mapping *workload_map;
struct mutex sensor_lock;
struct mutex message_lock;
uint64_t pool_size;
......
......@@ -1113,7 +1113,6 @@ static int arcturus_read_sensor(struct smu_context *smu,
if (!data || !size)
return -EINVAL;
mutex_lock(&smu->sensor_lock);
switch (sensor) {
case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
*(uint32_t *)data = pptable->FanMaximumRpm;
......@@ -1174,7 +1173,6 @@ static int arcturus_read_sensor(struct smu_context *smu,
ret = -EOPNOTSUPP;
break;
}
mutex_unlock(&smu->sensor_lock);
return ret;
}
......
......@@ -209,8 +209,6 @@ static int cyan_skillfish_read_sensor(struct smu_context *smu,
if (!data || !size)
return -EINVAL;
mutex_lock(&smu->sensor_lock);
switch (sensor) {
case AMDGPU_PP_SENSOR_GFX_SCLK:
ret = cyan_skillfish_get_smu_metrics_data(smu,
......@@ -261,8 +259,6 @@ static int cyan_skillfish_read_sensor(struct smu_context *smu,
break;
}
mutex_unlock(&smu->sensor_lock);
return ret;
}
......
......@@ -1964,7 +1964,6 @@ static int navi10_read_sensor(struct smu_context *smu,
if(!data || !size)
return -EINVAL;
mutex_lock(&smu->sensor_lock);
switch (sensor) {
case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
*(uint32_t *)data = pptable->FanMaximumRpm;
......@@ -2024,7 +2023,6 @@ static int navi10_read_sensor(struct smu_context *smu,
ret = -EOPNOTSUPP;
break;
}
mutex_unlock(&smu->sensor_lock);
return ret;
}
......
......@@ -1619,7 +1619,6 @@ static int sienna_cichlid_read_sensor(struct smu_context *smu,
if(!data || !size)
return -EINVAL;
mutex_lock(&smu->sensor_lock);
switch (sensor) {
case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
GET_PPTABLE_MEMBER(FanMaximumRpm, &temp);
......@@ -1680,7 +1679,6 @@ static int sienna_cichlid_read_sensor(struct smu_context *smu,
ret = -EOPNOTSUPP;
break;
}
mutex_unlock(&smu->sensor_lock);
return ret;
}
......
......@@ -1494,7 +1494,6 @@ static int vangogh_read_sensor(struct smu_context *smu,
if (!data || !size)
return -EINVAL;
mutex_lock(&smu->sensor_lock);
switch (sensor) {
case AMDGPU_PP_SENSOR_GPU_LOAD:
ret = vangogh_common_get_smu_metrics_data(smu,
......@@ -1556,7 +1555,6 @@ static int vangogh_read_sensor(struct smu_context *smu,
ret = -EOPNOTSUPP;
break;
}
mutex_unlock(&smu->sensor_lock);
return ret;
}
......
......@@ -1209,7 +1209,6 @@ static int renoir_read_sensor(struct smu_context *smu,
if (!data || !size)
return -EINVAL;
mutex_lock(&smu->sensor_lock);
switch (sensor) {
case AMDGPU_PP_SENSOR_GPU_LOAD:
ret = renoir_get_smu_metrics_data(smu,
......@@ -1277,7 +1276,6 @@ static int renoir_read_sensor(struct smu_context *smu,
ret = -EOPNOTSUPP;
break;
}
mutex_unlock(&smu->sensor_lock);
return ret;
}
......
......@@ -1141,7 +1141,6 @@ static int aldebaran_read_sensor(struct smu_context *smu,
if (!data || !size)
return -EINVAL;
mutex_lock(&smu->sensor_lock);
switch (sensor) {
case AMDGPU_PP_SENSOR_MEM_LOAD:
case AMDGPU_PP_SENSOR_GPU_LOAD:
......@@ -1180,7 +1179,6 @@ static int aldebaran_read_sensor(struct smu_context *smu,
ret = -EOPNOTSUPP;
break;
}
mutex_unlock(&smu->sensor_lock);
return ret;
}
......
......@@ -395,7 +395,6 @@ static int yellow_carp_read_sensor(struct smu_context *smu,
if (!data || !size)
return -EINVAL;
mutex_lock(&smu->sensor_lock);
switch (sensor) {
case AMDGPU_PP_SENSOR_GPU_LOAD:
ret = yellow_carp_get_smu_metrics_data(smu,
......@@ -463,7 +462,6 @@ static int yellow_carp_read_sensor(struct smu_context *smu,
ret = -EOPNOTSUPP;
break;
}
mutex_unlock(&smu->sensor_lock);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment