]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/pm: invalidate hdp before CPU access the memory written by GPU
authorEvan Quan <evan.quan@amd.com>
Fri, 27 Nov 2020 02:57:22 +0000 (10:57 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Dec 2020 04:01:24 +0000 (23:01 -0500)
To eliminate the possible influence by outdated HDP read cache.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c

index ea2279bb8cbfd24a77799e9ee5acb0896b347ef8..47b34c6ca924ea17e41bf1fb48a25bcf36c41f89 100644 (file)
@@ -139,8 +139,7 @@ static int smu10_copy_table_from_smc(struct pp_hwmgr *hwmgr,
                        priv->smu_tables.entry[table_id].table_id,
                        NULL);
 
-       /* flush hdp cache */
-       amdgpu_asic_flush_hdp(adev, NULL);
+       amdgpu_asic_invalidate_hdp(adev, NULL);
 
        memcpy(table, (uint8_t *)priv->smu_tables.entry[table_id].table,
                        priv->smu_tables.entry[table_id].size);
index 85e08a5526854db9240990d4de2d0505f1b0e2e5..a70d738966490493a4421991c865c91507bd12a3 100644 (file)
@@ -60,8 +60,7 @@ static int vega10_copy_table_from_smc(struct pp_hwmgr *hwmgr,
                        priv->smu_tables.entry[table_id].table_id,
                        NULL);
 
-       /* flush hdp cache */
-       amdgpu_asic_flush_hdp(adev, NULL);
+       amdgpu_asic_invalidate_hdp(adev, NULL);
 
        memcpy(table, priv->smu_tables.entry[table_id].table,
                        priv->smu_tables.entry[table_id].size);
index f54df76537e4b197b246234ba3b00af4a38f069a..b52ce135d84d4601b5e0e51d21de853c5236a15a 100644 (file)
@@ -68,8 +68,7 @@ static int vega12_copy_table_from_smc(struct pp_hwmgr *hwmgr,
                        "[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!",
                        return -EINVAL);
 
-       /* flush hdp cache */
-       amdgpu_asic_flush_hdp(adev, NULL);
+       amdgpu_asic_invalidate_hdp(adev, NULL);
 
        memcpy(table, priv->smu_tables.entry[table_id].table,
                        priv->smu_tables.entry[table_id].size);
index cf43629d29d268aeaf53861b1ce7662264572c38..741fbc87467f9236730723f9231c094d44c34d48 100644 (file)
@@ -192,8 +192,7 @@ static int vega20_copy_table_from_smc(struct pp_hwmgr *hwmgr,
                        "[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!",
                        return ret);
 
-       /* flush hdp cache */
-       amdgpu_asic_flush_hdp(adev, NULL);
+       amdgpu_asic_invalidate_hdp(adev, NULL);
 
        memcpy(table, priv->smu_tables.entry[table_id].table,
                        priv->smu_tables.entry[table_id].size);
@@ -307,8 +306,7 @@ int vega20_get_activity_monitor_coeff(struct pp_hwmgr *hwmgr,
                        "[GetActivityMonitor] Attempt to Transfer Table From SMU Failed!",
                        return ret);
 
-       /* flush hdp cache */
-       amdgpu_asic_flush_hdp(adev, NULL);
+       amdgpu_asic_invalidate_hdp(adev, NULL);
 
        memcpy(table, priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].table,
                        priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].size);
index dc28f22aeb38934cc3c5ac90ebe4a16c65a6aeb8..f8260769061c538e630b60f1857d161806d9ba48 100644 (file)
@@ -655,7 +655,7 @@ int smu_cmn_update_table(struct smu_context *smu,
                return ret;
 
        if (!drv2smu) {
-               amdgpu_asic_flush_hdp(adev, NULL);
+               amdgpu_asic_invalidate_hdp(adev, NULL);
                memcpy(table_data, table->cpu_addr, table_size);
        }