drm/amd/pm: Fix error of MACO flag setting code
authorjsg <jsg@openbsd.org>
Thu, 30 Nov 2023 02:49:07 +0000 (02:49 +0000)
committerjsg <jsg@openbsd.org>
Thu, 30 Nov 2023 02:49:07 +0000 (02:49 +0000)
From Ma Jun
454d0cdd7c127bb0ad06b53c52e94ca2c9a83b20 in linux-6.1.y/6.1.64
7f3e6b840fa8b0889d776639310a5dc672c1e9e1 in mainline linux

sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c

index b9799dd..6ba0978 100644 (file)
@@ -324,12 +324,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;
+       }
 
        table_context->thermal_controller_type =
                powerplay_table->thermal_controller_type;
index 165992d..5c66151 100644 (file)
@@ -326,12 +326,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;
+       }
 
        table_context->thermal_controller_type =
                powerplay_table->thermal_controller_type;