diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3516-drm-amd-powerplay-udpate-smu_v12_0_check_fw_version-.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3516-drm-amd-powerplay-udpate-smu_v12_0_check_fw_version-.patch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3516-drm-amd-powerplay-udpate-smu_v12_0_check_fw_version-.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3516-drm-amd-powerplay-udpate-smu_v12_0_check_fw_version-.patch new file mode 100644 index 00000000..cdcdd3e8 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3516-drm-amd-powerplay-udpate-smu_v12_0_check_fw_version-.patch @@ -0,0 +1,91 @@ +From c8dbc592cd404620b4abfd8fdb8afb68a834e353 Mon Sep 17 00:00:00 2001 +From: Aaron Liu <aaron.liu@amd.com> +Date: Tue, 23 Jul 2019 10:39:38 +0800 +Subject: [PATCH 3516/4256] drm/amd/powerplay: udpate + smu_v12_0_check_fw_version (v2) + +This interface support SMU_MSG_GetDriverIfVersion +and SMU_MSG_GetSmuVersion checking. + +v2: squash in driver_if changes (Alex) + +Signed-off-by: Aaron Liu <aaron.liu@amd.com> +Reviewed-by: Huang Rui <ray.huang@amd.com> +Reviewed-by: Evan Quan <evan.quan@amd.com> +Signed-off-by: Alex Deucher <alexander.deucher@amd.com> +--- + drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 2 ++ + drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 35 +++++++++++++++------- + 2 files changed, 27 insertions(+), 10 deletions(-) + +diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c +index dd270600962b..af8bb1cc5d9a 100644 +--- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c ++++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c +@@ -25,6 +25,7 @@ + #include "amdgpu_smu.h" + #include "soc15_common.h" + #include "smu_v12_0_ppsmc.h" ++#include "smu12_driver_if.h" + #include "renoir_ppt.h" + + +@@ -118,4 +119,5 @@ static const struct pptable_funcs renoir_ppt_funcs = { + void renoir_set_ppt_funcs(struct smu_context *smu) + { + smu->ppt_funcs = &renoir_ppt_funcs; ++ smu->smc_if_version = SMU12_DRIVER_IF_VERSION; + } +diff --git a/drivers/gpu/drm/amd/powerplay/smu_v12_0.c b/drivers/gpu/drm/amd/powerplay/smu_v12_0.c +index 583fe7da4a4b..695b9af8662b 100644 +--- a/drivers/gpu/drm/amd/powerplay/smu_v12_0.c ++++ b/drivers/gpu/drm/amd/powerplay/smu_v12_0.c +@@ -144,20 +144,35 @@ static int smu_v12_0_check_fw_status(struct smu_context *smu) + + static int smu_v12_0_check_fw_version(struct smu_context *smu) + { +- uint32_t smc_if_version = 0xff; ++ uint32_t if_version = 0xff, smu_version = 0xff; ++ uint16_t smu_major; ++ uint8_t smu_minor, smu_debug; + int ret = 0; + +- ret = smu_send_smc_msg(smu, SMU_MSG_GetDriverIfVersion); ++ ret = smu_get_smc_version(smu, &if_version, &smu_version); + if (ret) +- goto err; +- +- ret = smu_read_smc_arg(smu, &smc_if_version); +- if (ret) +- goto err; ++ return ret; ++ ++ smu_major = (smu_version >> 16) & 0xffff; ++ smu_minor = (smu_version >> 8) & 0xff; ++ smu_debug = (smu_version >> 0) & 0xff; ++ ++ /* ++ * 1. if_version mismatch is not critical as our fw is designed ++ * to be backward compatible. ++ * 2. New fw usually brings some optimizations. But that's visible ++ * only on the paired driver. ++ * Considering above, we just leave user a warning message instead ++ * of halt driver loading. ++ */ ++ if (if_version != smu->smc_if_version) { ++ pr_info("smu driver if version = 0x%08x, smu fw if version = 0x%08x, " ++ "smu fw version = 0x%08x (%d.%d.%d)\n", ++ smu->smc_if_version, if_version, ++ smu_version, smu_major, smu_minor, smu_debug); ++ pr_warn("SMU driver if version not matched\n"); ++ } + +- if (smc_if_version != smu->smc_if_version) +- ret = -EINVAL; +-err: + return ret; + } + +-- +2.17.1 + |