diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4471-drm-amd-powerplay-issue-no-PPSMC_MSG_GetCurrPkgPwr-o.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4471-drm-amd-powerplay-issue-no-PPSMC_MSG_GetCurrPkgPwr-o.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4471-drm-amd-powerplay-issue-no-PPSMC_MSG_GetCurrPkgPwr-o.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4471-drm-amd-powerplay-issue-no-PPSMC_MSG_GetCurrPkgPwr-o.patch new file mode 100644 index 00000000..a840d469 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4471-drm-amd-powerplay-issue-no-PPSMC_MSG_GetCurrPkgPwr-o.patch @@ -0,0 +1,59 @@ +From d1cfc704affbbc82579adff6d3a769b38d9f6500 Mon Sep 17 00:00:00 2001 +From: Evan Quan <evan.quan@amd.com> +Date: Thu, 14 Nov 2019 15:30:39 +0800 +Subject: [PATCH 4471/4736] drm/amd/powerplay: issue no PPSMC_MSG_GetCurrPkgPwr + on unsupported ASICs + +Otherwise, the error message prompted will confuse user. + +Change-Id: I44b9f870a8663714d715a1d5bf2aa24abe75bb8e +Signed-off-by: Evan Quan <evan.quan@amd.com> +Acked-by: Alex Deucher <alexander.deucher@amd.com> +--- + .../gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 23 +++++++++++++++---- + 1 file changed, 18 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +index d3c3b3512a16..5c6b71b356e7 100644 +--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c ++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +@@ -3476,18 +3476,31 @@ static int smu7_get_pp_table_entry(struct pp_hwmgr *hwmgr, + + static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, u32 *query) + { ++ struct amdgpu_device *adev = hwmgr->adev; + int i; + u32 tmp = 0; + + if (!query) + return -EINVAL; + +- smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0); +- tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0); +- *query = tmp; ++ /* ++ * PPSMC_MSG_GetCurrPkgPwr is not supported on: ++ * - Hawaii ++ * - Bonaire ++ * - Fiji ++ * - Tonga ++ */ ++ if ((adev->asic_type != CHIP_HAWAII) && ++ (adev->asic_type != CHIP_BONAIRE) && ++ (adev->asic_type != CHIP_FIJI) && ++ (adev->asic_type != CHIP_TONGA)) { ++ smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0); ++ tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0); ++ *query = tmp; + +- if (tmp != 0) +- return 0; ++ if (tmp != 0) ++ return 0; ++ } + + smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogStart); + cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, +-- +2.17.1 + |