Skip to contentSkip to conversation

Please apply 8b55f8818900 to 6.12 through 6.1

PATCH Nathan Chancellor 1 participant 1 message Apr 17, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Greg and Sasha,

Please consider applying commit 8b55f8818900 ("media: mediatek: vcodec:
mark vdec_vp9_slice_map_counts_eob_coef noinline") to 6.12, 6.6, and 6.1, as it avoids a warning that breaks arm64 allmodconfig for certain clang versions due to -Werror. It applies cleanly to the first two trees for me and I have attached a backport for 6.1 due to a file location change. Please let me know if there are any issues.

Cheers,
Nathan

From 062b81d06d45f6ef9b9045a6fd3b4359bb80e481 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <[email protected]>
Date: Fri, 18 Oct 2024 15:14:42 +0000
Subject: [PATCH 6.1] media: mediatek: vcodec: mark
vdec_vp9_slice_map_counts_eob_coef noinline

commit 8b55f8818900c99dd4f55a59a103f5b29e41eb2c upstream.

With KASAN enabled, clang fails to optimize the inline version of vdec_vp9_slice_map_counts_eob_coef() properly, leading to kilobytes of temporary values spilled to the stack:

drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c:1526:12: error: stack frame size (2160) exceeds limit (2048) in 'vdec_vp9_slice_update_prob' [-Werror,-Wframe-larger-than]

This seems to affect all versions of clang including the latest (clang-20), but the degree of stack overhead is different per release.

Marking the function as noinline_for_stack is harmless here and avoids the problem completely.

---
 .../media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c +2 -1
index cf16cf2807f0..f0e207044bf3 100644
@@ -1192,7 +1192,8 @@ static int vdec_vp9_slice_setup_lat(struct vdec_vp9_slice_instance *instance,
 	return ret;
 }
 
-static
+/* clang stack usage explodes if this is inlined */
+static noinline_for_stack
 void vdec_vp9_slice_map_counts_eob_coef(unsigned int i, unsigned int j, unsigned int k,
 					struct vdec_vp9_slice_frame_counts *counts,
 					struct v4l2_vp9_frame_symbol_counts *counts_helper)

base-commit: 420102835862f49ec15c545594278dc5d2712f42

Signature · 1 line
2.49.0