]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/pm: drop unnecessary smu_baco->mutex lock protections(V2)
authorEvan Quan <evan.quan@amd.com>
Mon, 24 Aug 2020 07:18:00 +0000 (15:18 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 17 Sep 2020 21:47:25 +0000 (17:47 -0400)
As these operations are performed in hardware setup and there
is actually no race conditions during this period considering:
1. the hardware setup is serial and cannot be in parallel
2. all other operations can be performed only after hardware
   setup complete.

V2: rich the commit log description

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Nirmoy Das <nirmoy.das@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_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/smu_v11_0.c

index 2ce6ad9c6609454734246e9653b3828d9cd18bce..d298fa65274dfe4333484f4e5ba60a636bd8a9b2 100644 (file)
@@ -386,11 +386,9 @@ static int arcturus_check_powerplay_table(struct smu_context *smu)
                table_context->power_play_table;
        struct smu_baco_context *smu_baco = &smu->smu_baco;
 
-       mutex_lock(&smu_baco->mutex);
        if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
            powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO)
                smu_baco->platform_support = true;
-       mutex_unlock(&smu_baco->mutex);
 
        table_context->thermal_controller_type =
                powerplay_table->thermal_controller_type;
index 3559ba05a59cc3821faad6f2b30b95d173e25407..7e1d6c278b34cb43cd68423b4941c228968a5b0a 100644 (file)
@@ -336,11 +336,9 @@ static int navi10_check_powerplay_table(struct smu_context *smu)
        if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_HARDWAREDC)
                smu->dc_controlled_by_gpio = true;
 
-       mutex_lock(&smu_baco->mutex);
        if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
            powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO)
                smu_baco->platform_support = true;
-       mutex_unlock(&smu_baco->mutex);
 
        table_context->thermal_controller_type =
                powerplay_table->thermal_controller_type;
index 9cf4e9aef117085f92981174f1b698dae027d05e..be9cd0371064f03d461c8237b52def5e74c13018 100644 (file)
@@ -298,11 +298,9 @@ static int sienna_cichlid_check_powerplay_table(struct smu_context *smu)
                table_context->power_play_table;
        struct smu_baco_context *smu_baco = &smu->smu_baco;
 
-       mutex_lock(&smu_baco->mutex);
        if (powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_BACO ||
            powerplay_table->platform_caps & SMU_11_0_7_PP_PLATFORM_CAP_MACO)
                smu_baco->platform_support = true;
-       mutex_unlock(&smu_baco->mutex);
 
        table_context->thermal_controller_type =
                powerplay_table->thermal_controller_type;
index 48987f3c4d123437ff8d823c9b00e6b87d2aec7b..4aa257c07ac6f67d992df91a5727da3c25a4131d 100644 (file)
@@ -1426,13 +1426,8 @@ static int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu, enum smu_v
 bool smu_v11_0_baco_is_support(struct smu_context *smu)
 {
        struct smu_baco_context *smu_baco = &smu->smu_baco;
-       bool baco_support;
 
-       mutex_lock(&smu_baco->mutex);
-       baco_support = smu_baco->platform_support;
-       mutex_unlock(&smu_baco->mutex);
-
-       if (!baco_support)
+       if (!smu_baco->platform_support)
                return false;
 
        /* Arcturus does not support this bit mask */