android_kernel_motorola_sm6375/drivers/mtd
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Arnd Bergmann 4a5aaa1747 mtd: lpddr: fix excessive stack usage with clang
[ Upstream commit 3e1b6469f8324bee5927b063e2aca30d3e56b907 ]

Building lpddr2_nvm with clang can result in a giant stack usage
in one function:

drivers/mtd/lpddr/lpddr2_nvm.c:399:12: error: stack frame size of 1144 bytes in function 'lpddr2_nvm_probe' [-Werror,-Wframe-larger-than=]

The problem is that clang decides to build a copy of the mtd_info
structure on the stack and then do a memcpy() into the actual version. It
shouldn't really do it that way, but it's not strictly a bug either.

As a workaround, use a static const version of the structure to assign
most of the members upfront and then only set the few members that
require runtime knowledge at probe time.

Fixes: 96ba9dd657 ("mtd: lpddr: add driver for LPDDR2-NVM PCM memories")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200505140136.263461-1-arnd@arndb.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-29 09:57:46 +01:00
..
chips mtd: cfi_cmdset_0002: don't free cfi->cfiq in error path of cfi_amdstd_setup() 2020-10-01 13:17:16 +02:00
devices mtd: phram: fix a double free issue in error path 2020-04-23 10:36:45 +02:00
hyperbus
lpddr mtd: lpddr: fix excessive stack usage with clang 2020-10-29 09:57:46 +01:00
maps
nand mtd: rawnand: omap_elm: Fix runtime PM imbalance on error 2020-10-01 13:18:07 +02:00
parsers mtd: parser: cmdline: Support MTD names containing one or more colons 2020-10-01 13:18:08 +02:00
spi-nor
tests
ubi ubi: fastmap: Free unused fastmap anchor peb during detach 2020-10-01 13:18:11 +02:00
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c
mtdblock.c
mtdblock_ro.c
mtdchar.c mtd: properly check all write ioctls for permissions 2020-08-11 15:33:35 +02:00
mtdconcat.c
mtdcore.c mtd: Fix mtd not registered due to nvmem name collision 2020-05-27 17:46:22 +02:00
mtdcore.h
mtdoops.c
mtdpart.c
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c