]> git.hungrycats.org Git - linux/commitdiff
drm/amd/pm: Fix error of MACO flag setting code
authorMa Jun <Jun.Ma2@amd.com>
Tue, 31 Oct 2023 03:11:04 +0000 (11:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:15:18 +0000 (17:15 +0000)
commit 7f3e6b840fa8b0889d776639310a5dc672c1e9e1 upstream.

MACO only works if BACO is supported

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.1.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c

index 0fb6be11a0cc7a611ed4275b37740cf04934cbff..ef59c873710582725ff977f236842823f784f7e1 100644 (file)
@@ -343,12 +343,12 @@ static int smu_v13_0_0_check_powerplay_table(struct smu_context *smu)
        if (powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_HARDWAREDC)
                smu->dc_controlled_by_gpio = true;
 
-       if (powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_BACO ||
-           powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_MACO)
+       if (powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_BACO) {
                smu_baco->platform_support = true;
 
-       if (powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_MACO)
-               smu_baco->maco_support = true;
+               if (powerplay_table->platform_caps & SMU_13_0_0_PP_PLATFORM_CAP_MACO)
+                       smu_baco->maco_support = true;
+       }
 
        /*
         * We are in the transition to a new OD mechanism.
index 62f2886ab4df6bbff9c84e0422cad4c5414ce51f..8cc16b3d18a3aa07ee2d20c7418f4d777d6cab2f 100644 (file)
@@ -333,12 +333,13 @@ static int smu_v13_0_7_check_powerplay_table(struct smu_context *smu)
        if (powerplay_table->platform_caps & SMU_13_0_7_PP_PLATFORM_CAP_HARDWAREDC)
                smu->dc_controlled_by_gpio = true;
 
-       if (powerplay_table->platform_caps & SMU_13_0_7_PP_PLATFORM_CAP_BACO ||
-           powerplay_table->platform_caps & SMU_13_0_7_PP_PLATFORM_CAP_MACO)
+       if (powerplay_table->platform_caps & SMU_13_0_7_PP_PLATFORM_CAP_BACO) {
                smu_baco->platform_support = true;
 
-       if (smu_baco->platform_support && (BoardTable->HsrEnabled || BoardTable->VddqOffEnabled))
-               smu_baco->maco_support = true;
+               if ((powerplay_table->platform_caps & SMU_13_0_7_PP_PLATFORM_CAP_MACO)
+                                       && (BoardTable->HsrEnabled || BoardTable->VddqOffEnabled))
+                       smu_baco->maco_support = true;
+       }
 
 #if 0
        if (!overdrive_lowerlimits->FeatureCtrlMask ||