aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/1497-drm-amd-powerplay-fix-the-issue-of-checking-on-messa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1497-drm-amd-powerplay-fix-the-issue-of-checking-on-messa.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/1497-drm-amd-powerplay-fix-the-issue-of-checking-on-messa.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1497-drm-amd-powerplay-fix-the-issue-of-checking-on-messa.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1497-drm-amd-powerplay-fix-the-issue-of-checking-on-messa.patch
new file mode 100644
index 00000000..d06cc215
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1497-drm-amd-powerplay-fix-the-issue-of-checking-on-messa.patch
@@ -0,0 +1,40 @@
+From 4cb800f304999a45fa7aaa25d23e8fda5cf5a253 Mon Sep 17 00:00:00 2001
+From: Huang Rui <ray.huang@amd.com>
+Date: Mon, 25 Feb 2019 19:43:00 +0800
+Subject: [PATCH 1497/2940] drm/amd/powerplay: fix the issue of checking on
+ message mapping
+
+The vega20_message_map[index] scope should be in PPSMC_Message_Count not in
+SMU_MSG_MAX_COUNT.
+
+Signed-off-by: Huang Rui <ray.huang@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+index e6db56d158eb..6763dcd21cf1 100644
+--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
++++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+@@ -131,10 +131,15 @@ static int vega20_message_map[SMU_MSG_MAX_COUNT] = {
+
+ static int vega20_get_smu_msg_index(struct smu_context *smc, uint32_t index)
+ {
+- if (index > SMU_MSG_MAX_COUNT || index > PPSMC_Message_Count)
++ int val;
++ if (index > SMU_MSG_MAX_COUNT)
+ return -EINVAL;
+- return vega20_message_map[index];
+
++ val = vega20_message_map[index];
++ if (val > PPSMC_Message_Count)
++ return -EINVAL;
++
++ return val;
+ }
+
+ static int vega20_allocate_dpm_context(struct smu_context *smu)
+--
+2.17.1
+