diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/4639-drm-amd-pp-initialize-result-to-before-or-ing-in-dat.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.14.71/4639-drm-amd-pp-initialize-result-to-before-or-ing-in-dat.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/4639-drm-amd-pp-initialize-result-to-before-or-ing-in-dat.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/4639-drm-amd-pp-initialize-result-to-before-or-ing-in-dat.patch new file mode 100644 index 00000000..7c1f5162 --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/4639-drm-amd-pp-initialize-result-to-before-or-ing-in-dat.patch @@ -0,0 +1,40 @@ +From 4d28f47d2370f7d0d3a4eb83383d60e43b472342 Mon Sep 17 00:00:00 2001 +From: Colin Ian King <colin.king@canonical.com> +Date: Wed, 6 Jun 2018 13:18:31 +0100 +Subject: [PATCH 4639/5725] drm/amd/pp: initialize result to before or'ing in + data + +The current use of result is or'ing in values and checking for +a non-zero result, however, result is not initialized to zero +so it potentially contains garbage to start with. Fix this by +initializing it to the first return from the call to +vega10_program_didt_config_registers. + +Detected by cppcheck: +"(error) Uninitialized variable: result" + +Fixes: 9b7b8154cdb8 ("drm/amd/powerplay: added didt support for vega10") +Signed-off-by: Colin Ian King <colin.king@canonical.com> +Acked-by: Huang Rui <ray.huang@amd.com> +[Fix the subject as Colin's comment] +Signed-off-by: Huang Rui <ray.huang@amd.com> +--- + drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c +index a9efd855..dbe4b1f 100644 +--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c ++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c +@@ -1104,7 +1104,7 @@ static int vega10_enable_psm_gc_edc_config(struct pp_hwmgr *hwmgr) + for (count = 0; count < num_se; count++) { + data = GRBM_GFX_INDEX__INSTANCE_BROADCAST_WRITES_MASK | GRBM_GFX_INDEX__SH_BROADCAST_WRITES_MASK | ( count << GRBM_GFX_INDEX__SE_INDEX__SHIFT); + WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, data); +- result |= vega10_program_didt_config_registers(hwmgr, PSMSEEDCStallPatternConfig_Vega10, VEGA10_CONFIGREG_DIDT); ++ result = vega10_program_didt_config_registers(hwmgr, PSMSEEDCStallPatternConfig_Vega10, VEGA10_CONFIGREG_DIDT); + result |= vega10_program_didt_config_registers(hwmgr, PSMSEEDCStallDelayConfig_Vega10, VEGA10_CONFIGREG_DIDT); + result |= vega10_program_didt_config_registers(hwmgr, PSMSEEDCCtrlResetConfig_Vega10, VEGA10_CONFIGREG_DIDT); + result |= vega10_program_didt_config_registers(hwmgr, PSMSEEDCCtrlConfig_Vega10, VEGA10_CONFIGREG_DIDT); +-- +2.7.4 + |