From: Sasha Levin Date: Mon, 6 Jul 2026 14:07:16 +0000 (-0400) Subject: Fixes for all trees X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b6d15a70f8b522bfe4178411ead1d2ec72abe22;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for all trees Signed-off-by: Sasha Levin --- diff --git a/queue-6.12/drm-amd-fix-set-but-not-used-warnings.patch b/queue-6.12/drm-amd-fix-set-but-not-used-warnings.patch new file mode 100644 index 0000000000..cb67cf2674 --- /dev/null +++ b/queue-6.12/drm-amd-fix-set-but-not-used-warnings.patch @@ -0,0 +1,140 @@ +From b451972113bb4061c8b009a51a4ba5c79492089d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 5 Jul 2026 21:40:03 -0700 +Subject: drm/amd: Fix set but not used warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Tiezhu Yang + +[ Upstream commit 46791d147d3ab3262298478106ef2a52fc7192e2 ] + +There are many set but not used warnings under drivers/gpu/drm/amd when +compiling with the latest upstream mainline GCC: + + drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c:305:18: warning: variable ‘p’ set but not used [-Wunused-but-set-variable=] + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h:103:26: warning: variable ‘internal_reg_offset’ set but not used [-Wunused-but-set-variable=] + ... + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h:164:26: warning: variable ‘internal_reg_offset’ set but not used [-Wunused-but-set-variable=] + ... + drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:445:13: warning: variable ‘pipe_idx’ set but not used [-Wunused-but-set-variable=] + drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:875:21: warning: variable ‘pipe_idx’ set but not used [-Wunused-but-set-variable=] + +Remove the variables actually not used or add __maybe_unused attribute for +the variables actually used to fix them, compile tested only. + +Signed-off-by: Tiezhu Yang +Signed-off-by: Alex Deucher +Signed-off-by: Ron Economos +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 4 +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 6 ++++-- + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 9 +++------ + 3 files changed, 8 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +index 30b4e2c406f319..2e62dfd03c92e7 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +@@ -307,7 +307,6 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset, + int pages) + { + unsigned t; +- unsigned p; + int i, j; + u64 page_base; + /* Starting from VEGA10, system bit must be 0 to mean invalid. */ +@@ -321,8 +320,7 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset, + return; + + t = offset / AMDGPU_GPU_PAGE_SIZE; +- p = t / AMDGPU_GPU_PAGES_IN_CPU_PAGE; +- for (i = 0; i < pages; i++, p++) { ++ for (i = 0; i < pages; i++) { + page_base = adev->dummy_page_addr; + if (!adev->gart.ptr) + continue; +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +index 3b6254de2c0e5f..d20236826e6cb8 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +@@ -100,7 +100,8 @@ + + #define SOC15_DPG_MODE_OFFSET(ip, inst_idx, reg) \ + ({ \ +- uint32_t internal_reg_offset, addr; \ ++ /* To avoid a -Wunused-but-set-variable warning. */ \ ++ uint32_t internal_reg_offset __maybe_unused, addr; \ + bool video_range, video1_range, aon_range, aon1_range; \ + \ + addr = (adev->reg_offset[ip##_HWIP][inst_idx][reg##_BASE_IDX] + reg); \ +@@ -161,7 +162,8 @@ + + #define SOC24_DPG_MODE_OFFSET(ip, inst_idx, reg) \ + ({ \ +- uint32_t internal_reg_offset, addr; \ ++ /* To avoid a -Wunused-but-set-variable warning. */ \ ++ uint32_t internal_reg_offset __maybe_unused, addr; \ + bool video_range, aon_range; \ + \ + addr = (adev->reg_offset[ip##_HWIP][inst_idx][reg##_BASE_IDX] + reg); \ +diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +index ec5009f411eb0d..19b8d46ce848d7 100644 +--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c ++++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +@@ -428,7 +428,6 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru + int i = 0, k = 0; + int ramp_up_num_steps = 1; // TODO: Ramp is currently disabled. Reenable it. + uint8_t visual_confirm_enabled; +- int pipe_idx = 0; + struct dc_stream_status *stream_status = NULL; + + if (dc == NULL) +@@ -443,7 +442,7 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru + cmd.fw_assisted_mclk_switch.config_data.visual_confirm_enabled = visual_confirm_enabled; + + if (should_manage_pstate) { +- for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) { ++ for (i = 0; i < dc->res_pool->pipe_count; i++) { + struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; + + if (!pipe->stream) +@@ -458,7 +457,6 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru + cmd.fw_assisted_mclk_switch.config_data.vactive_stretch_margin_us = dc->debug.fpo_vactive_margin_us; + break; + } +- pipe_idx++; + } + } + +@@ -857,7 +855,7 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, + bool enable) + { + uint8_t cmd_pipe_index = 0; +- uint32_t i, pipe_idx; ++ uint32_t i; + uint8_t subvp_count = 0; + union dmub_rb_cmd cmd; + struct pipe_ctx *subvp_pipes[2]; +@@ -884,7 +882,7 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, + + if (enable) { + // For each pipe that is a "main" SUBVP pipe, fill in pipe data for DMUB SUBVP cmd +- for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) { ++ for (i = 0; i < dc->res_pool->pipe_count; i++) { + struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; + pipe_mall_type = dc_state_get_pipe_subvp_type(context, pipe); + +@@ -907,7 +905,6 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, + populate_subvp_cmd_vblank_pipe_info(dc, context, &cmd, pipe, cmd_pipe_index++); + + } +- pipe_idx++; + } + if (subvp_count == 2) { + update_subvp_prefetch_end_to_mall_start(dc, context, &cmd, subvp_pipes); +-- +2.53.0 + diff --git a/queue-6.12/series b/queue-6.12/series index cf03f1a136..f58616fcc3 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -4,3 +4,4 @@ nfsd-release-layout-stid-on-setlease-failure.patch userfaultfd-gate-must_wait-writability-check-on-pte_.patch perf-fix-dangling-cgroup-pointer-in-cpuctx-backport.patch bcachefs-avoid-truncating-fiemap-extent-length.patch +drm-amd-fix-set-but-not-used-warnings.patch diff --git a/queue-6.6/drm-amd-fix-set-but-not-used-warnings.patch b/queue-6.6/drm-amd-fix-set-but-not-used-warnings.patch new file mode 100644 index 0000000000..bda01a04f2 --- /dev/null +++ b/queue-6.6/drm-amd-fix-set-but-not-used-warnings.patch @@ -0,0 +1,137 @@ +From 859cf69c6ddda94a2f1a2cfa5d1da477600f4738 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 5 Jul 2026 21:42:00 -0700 +Subject: drm/amd: Fix set but not used warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Tiezhu Yang + +[ Upstream commit 46791d147d3ab3262298478106ef2a52fc7192e2 ] + +There are many set but not used warnings under drivers/gpu/drm/amd when +compiling with the latest upstream mainline GCC: + + drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c:305:18: warning: variable ‘p’ set but not used [-Wunused-but-set-variable=] + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h:103:26: warning: variable ‘internal_reg_offset’ set but not used [-Wunused-but-set-variable=] + ... + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h:164:26: warning: variable ‘internal_reg_offset’ set but not used [-Wunused-but-set-variable=] + ... + drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:445:13: warning: variable ‘pipe_idx’ set but not used [-Wunused-but-set-variable=] + drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:875:21: warning: variable ‘pipe_idx’ set but not used [-Wunused-but-set-variable=] + +Remove the variables actually not used or add __maybe_unused attribute for +the variables actually used to fix them, compile tested only. + +Signed-off-by: Tiezhu Yang +Signed-off-by: Alex Deucher +Signed-off-by: Ron Economos +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 4 +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 3 ++- + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 11 ++++------- + 3 files changed, 7 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +index ea75c2b2bbb148..055aa0418a737e 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +@@ -299,7 +299,6 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset, + int pages) + { + unsigned t; +- unsigned p; + int i, j; + u64 page_base; + /* Starting from VEGA10, system bit must be 0 to mean invalid. */ +@@ -313,8 +312,7 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset, + return; + + t = offset / AMDGPU_GPU_PAGE_SIZE; +- p = t / AMDGPU_GPU_PAGES_IN_CPU_PAGE; +- for (i = 0; i < pages; i++, p++) { ++ for (i = 0; i < pages; i++) { + page_base = adev->dummy_page_addr; + if (!adev->gart.ptr) + continue; +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +index 3dc2cffdae4fca..ba45e85b23f1b7 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +@@ -101,7 +101,8 @@ + + #define SOC15_DPG_MODE_OFFSET(ip, inst_idx, reg) \ + ({ \ +- uint32_t internal_reg_offset, addr; \ ++ /* To avoid a -Wunused-but-set-variable warning. */ \ ++ uint32_t internal_reg_offset __maybe_unused, addr; \ + bool video_range, video1_range, aon_range, aon1_range; \ + \ + addr = (adev->reg_offset[ip##_HWIP][inst_idx][reg##_BASE_IDX] + reg); \ +diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +index 4c5ef3ef8dbdd7..30a79dffbd37ab 100644 +--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c ++++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +@@ -322,7 +322,6 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru + int i = 0, k = 0; + int ramp_up_num_steps = 1; // TODO: Ramp is currently disabled. Reenable it. + uint8_t visual_confirm_enabled; +- int pipe_idx = 0; + + if (dc == NULL) + return false; +@@ -336,7 +335,7 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru + cmd.fw_assisted_mclk_switch.config_data.visual_confirm_enabled = visual_confirm_enabled; + + if (should_manage_pstate) { +- for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) { ++ for (i = 0; i < dc->res_pool->pipe_count; i++) { + struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; + + if (!pipe->stream) +@@ -350,7 +349,6 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru + cmd.fw_assisted_mclk_switch.config_data.vactive_stretch_margin_us = dc->debug.fpo_vactive_margin_us; + break; + } +- pipe_idx++; + } + } + +@@ -714,7 +712,7 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, + bool enable) + { + uint8_t cmd_pipe_index = 0; +- uint32_t i, pipe_idx; ++ uint32_t i; + uint8_t subvp_count = 0; + union dmub_rb_cmd cmd; + struct pipe_ctx *subvp_pipes[2]; +@@ -740,7 +738,7 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, + + if (enable) { + // For each pipe that is a "main" SUBVP pipe, fill in pipe data for DMUB SUBVP cmd +- for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) { ++ for (i = 0; i < dc->res_pool->pipe_count; i++) { + struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; + + if (!pipe->stream) +@@ -763,7 +761,6 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, + populate_subvp_cmd_vblank_pipe_info(dc, context, &cmd, pipe, cmd_pipe_index++); + + } +- pipe_idx++; + } + if (subvp_count == 2) { + update_subvp_prefetch_end_to_mall_start(dc, context, &cmd, subvp_pipes); +@@ -1054,4 +1051,4 @@ void dc_dmub_srv_enable_dpia_trace(const struct dc *dc) + } + + DC_LOG_DEBUG("Enabled DPIA trace\n"); +-} +\ No newline at end of file ++} +-- +2.53.0 + diff --git a/queue-6.6/series b/queue-6.6/series index ba3cb9e4e3..949c161f30 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -18,3 +18,4 @@ slimbus-qcom-ngd-ctrl-fix-probe-error-path-ordering.patch slimbus-qcom-ngd-ctrl-correct-pdr-and-ssr-cleanup-ow.patch slimbus-convert-to-platform-remove-callback-returnin.patch slimbus-qcom-ngd-ctrl-register-callbacks-after-creat.patch +drm-amd-fix-set-but-not-used-warnings.patch