From: Greg Kroah-Hartman Date: Sun, 13 Aug 2023 21:09:44 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v4.14.323~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ba2df9584a83a2f01e0de512e42e97784eb82a1;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: drm-amd-pm-smu7-move-variables-to-where-they-are-used.patch --- diff --git a/queue-6.1/drm-amd-pm-smu7-move-variables-to-where-they-are-used.patch b/queue-6.1/drm-amd-pm-smu7-move-variables-to-where-they-are-used.patch new file mode 100644 index 00000000000..131908b33d8 --- /dev/null +++ b/queue-6.1/drm-amd-pm-smu7-move-variables-to-where-they-are-used.patch @@ -0,0 +1,60 @@ +From 63a9ab264a8c030482ab9e7e20b6c4c162299531 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 6 Feb 2023 11:47:47 -0500 +Subject: drm/amd/pm/smu7: move variables to where they are used + +From: Alex Deucher + +commit 63a9ab264a8c030482ab9e7e20b6c4c162299531 upstream. + +Move variable declarations to where they are used. Fixes +a segfault on smu7 V0 structures where some tables don't +exist. + +Cc: Evan Quan +Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2388 +Fixes: b1a9557a7d00 ("drm/amd/pm: fulfill powerplay peak profiling mode shader/memory clock settings") +Reviewed-by: Evan Quan +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c ++++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +@@ -1505,12 +1505,6 @@ static void smu7_populate_umdpstate_cloc + { + struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); + struct smu7_dpm_table *golden_dpm_table = &data->golden_dpm_table; +- struct phm_clock_voltage_dependency_table *vddc_dependency_on_sclk = +- hwmgr->dyn_state.vddc_dependency_on_sclk; +- struct phm_ppt_v1_information *table_info = +- (struct phm_ppt_v1_information *)(hwmgr->pptable); +- struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_sclk = +- table_info->vdd_dep_on_sclk; + int32_t tmp_sclk, count, percentage; + + if (golden_dpm_table->mclk_table.count == 1) { +@@ -1525,6 +1519,9 @@ static void smu7_populate_umdpstate_cloc + tmp_sclk = hwmgr->pstate_mclk * percentage / 100; + + if (hwmgr->pp_table_version == PP_TABLE_V0) { ++ struct phm_clock_voltage_dependency_table *vddc_dependency_on_sclk = ++ hwmgr->dyn_state.vddc_dependency_on_sclk; ++ + for (count = vddc_dependency_on_sclk->count - 1; count >= 0; count--) { + if (tmp_sclk >= vddc_dependency_on_sclk->entries[count].clk) { + hwmgr->pstate_sclk = vddc_dependency_on_sclk->entries[count].clk; +@@ -1537,6 +1534,11 @@ static void smu7_populate_umdpstate_cloc + hwmgr->pstate_sclk_peak = + vddc_dependency_on_sclk->entries[vddc_dependency_on_sclk->count - 1].clk; + } else if (hwmgr->pp_table_version == PP_TABLE_V1) { ++ struct phm_ppt_v1_information *table_info = ++ (struct phm_ppt_v1_information *)(hwmgr->pptable); ++ struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_sclk = ++ table_info->vdd_dep_on_sclk; ++ + for (count = vdd_dep_on_sclk->count - 1; count >= 0; count--) { + if (tmp_sclk >= vdd_dep_on_sclk->entries[count].clk) { + hwmgr->pstate_sclk = vdd_dep_on_sclk->entries[count].clk; diff --git a/queue-6.1/series b/queue-6.1/series index 0cab302d327..a70787eca9f 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -146,3 +146,4 @@ platform-x86-serial-multi-instantiate-auto-detect-irq-resource-for-csc3551.patch acpi-scan-create-platform-device-for-cs35l56.patch alpha-remove-__init-annotation-from-exported-page_is_ram.patch sch_netem-fix-issues-in-netem_change-vs-get_dist_table.patch +drm-amd-pm-smu7-move-variables-to-where-they-are-used.patch