Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: omapdrm: reduce clang stack usage

The thread sanitizer makes the stack usage explode from extra variable
spills in dispc_runtime_resume:

drivers/gpu/drm/omapdrm/dss/dispc.c:4735:27: error: stack frame size (1824) exceeds limit (1280) in 'dispc_runtime_resume' [-Werror,-Wframe-larger-than]

I could not figure out what exactly is going on here, but I see that
whenever dispc_restore_context() is not inlined, that function
and its caller shrink below 900 bytes combined of stack usage.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250610092737.2641862-1-arnd@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

authored by

Arnd Bergmann and committed by
Tomi Valkeinen
660942f2 c2aa5603

+1 -1
+1 -1
drivers/gpu/drm/omapdrm/dss/dispc.c
··· 524 524 DSSDBG("context saved\n"); 525 525 } 526 526 527 - static void dispc_restore_context(struct dispc_device *dispc) 527 + static noinline_for_stack void dispc_restore_context(struct dispc_device *dispc) 528 528 { 529 529 int i, j; 530 530