media: mediatek: vcodec: mark vdec_vp9_slice_map_counts_eob_coef noinline
authorArnd Bergmann <arnd@arndb.de>
Fri, 18 Oct 2024 15:14:42 +0000 (15:14 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 13 Dec 2024 16:51:35 +0000 (17:51 +0100)
commit8b55f8818900c99dd4f55a59a103f5b29e41eb2c
tree099c877e6bd64ac6d83495a68cfd25e3920b8be0
parent2dd59fe0e19e1ab955259978082b62e5751924c7
media: mediatek: vcodec: mark vdec_vp9_slice_map_counts_eob_coef noinline

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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c