drm/amd/pm: drop unneeded smu->sensor_lock
authorEvan Quan <evan.quan@amd.com>
Mon, 29 Nov 2021 05:51:34 +0000 (13:51 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Jan 2022 23:00:32 +0000 (18:00 -0500)
As all those related APIs are already well protected by
adev->pm.mutex and smu->message_lock.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c

index f10a0665a28692404364b182a3d247a4225b360a..57f3d26b03fe24e8a0408a503cf4f43c54200e58 100644 (file)
@@ -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);
index 63ed807c96f50df2562ca222baa00cd7cf3a58fa..2cef7ff46010c9dd8fd18a43bb4af090abfee366 100644 (file)
@@ -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;
 
index 5a8b2d549c2bd127932c40812c0662396f20bee0..2c78d04d561141eb7ebef66e3382a4f8cedf47b6 100644 (file)
@@ -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;
 }
index 7ae6b1bd648a7761065d83ff7c2074c987ad479f..2acd7470431e0f7768fec1f92847f187535b96b4 100644 (file)
@@ -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;
 }
 
index 68ead70673c5340909087e6b597372761d530b76..84834c24a7e9c547bd137f7c6d59fcc07724be43 100644 (file)
@@ -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;
 }
index 73579996a1abc295e9584d87bc384482d79e74bb..651fe748e4236aaff67d3af79361f256645e97fa 100644 (file)
@@ -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;
 }
index c736adca6fbbf738d2db2bfc1027a86829a44db9..721027917f81f8bca3ad1632cb0fb0446c55262d 100644 (file)
@@ -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;
 }
index d75508085578bddeff680e9ec88d7f1f880099e6..e99e7b2bf25b15e5b7ddb8a95925093e6f08985b 100644 (file)
@@ -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;
 }
index 05b7d8e381965aeb5cd3c5d27427fb635aca615b..8c02adbf446a7a24a1a0cbbc53664d907d28726e 100644 (file)
@@ -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;
 }
index 451d30dcc6399e221cb48ce5025d874b761d3f97..bd24a2632214dd8d9c2527f260a1e23886027d36 100644 (file)
@@ -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;
 }