mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm: panel: fix excessive stack usage in td028ttec1_prepare
@ 2020-01-07 21:27 Arnd Bergmann
  2020-01-07 22:00 ` Laurent Pinchart
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2020-01-07 21:27 UTC (permalink / raw)
  To: Thierry Reding, David Airlie, Daniel Vetter
  Cc: Oleksandr Natalenko, Arnd Bergmann, Sam Ravnborg,
	Laurent Pinchart, Linus Walleij, Boris Brezillon, Tomi Valkeinen,
	dri-devel, linux-kernel

With gcc -O3, the compiler can inline very aggressively,
leading to rather large stack usage:

drivers/gpu/drm/panel/panel-tpo-td028ttec1.c: In function 'td028ttec1_prepare':
drivers/gpu/drm/panel/panel-tpo-td028ttec1.c:233:1: error: the frame size of 2768 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
 }

Marking jbt_reg_write_1() as noinline avoids the case where
multiple instances of this function get inlined into the same
stack frame and each one adds a copy of 'tx_buf'.

Fixes: mmtom ("init/Kconfig: enable -O3 for all arches")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/panel/panel-tpo-td028ttec1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c
index cf29405a2dbe..17ee5e87141f 100644
--- a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c
+++ b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c
@@ -105,7 +105,7 @@ static int jbt_ret_write_0(struct td028ttec1_panel *lcd, u8 reg, int *err)
 	return ret;
 }
 
-static int jbt_reg_write_1(struct td028ttec1_panel *lcd,
+static int noinline_for_stack jbt_reg_write_1(struct td028ttec1_panel *lcd,
 			   u8 reg, u8 data, int *err)
 {
 	struct spi_device *spi = lcd->spi;
-- 
2.20.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-08 10:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 21:27 [PATCH] drm: panel: fix excessive stack usage in td028ttec1_prepare Arnd Bergmann
2020-01-07 22:00 ` Laurent Pinchart
2020-01-07 22:09   ` Arnd Bergmann
2020-01-07 22:12     ` Laurent Pinchart
2020-01-07 22:26       ` Arnd Bergmann
2020-01-08 10:31         ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®