aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2988-drm-amd-powerplay-avoid-access-before-allocation.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2988-drm-amd-powerplay-avoid-access-before-allocation.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2988-drm-amd-powerplay-avoid-access-before-allocation.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2988-drm-amd-powerplay-avoid-access-before-allocation.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2988-drm-amd-powerplay-avoid-access-before-allocation.patch
new file mode 100644
index 00000000..d780c043
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2988-drm-amd-powerplay-avoid-access-before-allocation.patch
@@ -0,0 +1,53 @@
+From 7d979ebd0b42fb1368b6327bd13e673ed7590ed6 Mon Sep 17 00:00:00 2001
+From: Evan Quan <evan.quan@amd.com>
+Date: Fri, 12 Jul 2019 10:32:02 +0800
+Subject: [PATCH 2988/4256] drm/amd/powerplay: avoid access before allocation
+
+No access before allocation.
+
+Change-Id: Ia1d78786f2400cd1cd227d1ab6ea4c6a71619e4c
+Signed-off-by: Evan Quan <evan.quan@amd.com>
+Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
+---
+ drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+index fd4f2d585bd6..7e8083b24012 100644
+--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
++++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+@@ -441,7 +441,6 @@ static int vega20_store_powerplay_table(struct smu_context *smu)
+ {
+ ATOM_Vega20_POWERPLAYTABLE *powerplay_table = NULL;
+ struct smu_table_context *table_context = &smu->smu_table;
+- int ret;
+
+ if (!table_context->power_play_table)
+ return -EINVAL;
+@@ -455,9 +454,7 @@ static int vega20_store_powerplay_table(struct smu_context *smu)
+ table_context->thermal_controller_type = powerplay_table->ucThermalControllerType;
+ table_context->TDPODLimit = le32_to_cpu(powerplay_table->OverDrive8Table.ODSettingsMax[ATOM_VEGA20_ODSETTING_POWERPERCENTAGE]);
+
+- ret = vega20_setup_od8_information(smu);
+-
+- return ret;
++ return 0;
+ }
+
+ static int vega20_append_powerplay_table(struct smu_context *smu)
+@@ -1507,6 +1504,12 @@ static int vega20_set_default_od8_setttings(struct smu_context *smu)
+
+ smu->od_settings = (void *)od8_settings;
+
++ ret = vega20_setup_od8_information(smu);
++ if (ret) {
++ pr_err("Retrieve board OD limits failed!\n");
++ return ret;
++ }
++
+ if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_SOCCLK_BIT)) {
+ if (od8_settings->od_feature_capabilities[ATOM_VEGA20_ODFEATURE_GFXCLK_LIMITS] &&
+ od8_settings->od_settings_max[OD8_SETTING_GFXCLK_FMAX] > 0 &&
+--
+2.17.1
+