Re: [PATCH] mtd: spi-nor: reduce stack usage in spi_nor_parse_sfdp()

From: Michael Walle

Date: Mon Sep 21 2026 - 03:56:23 EST


Hi Arnd,

On Tue Sep 15, 2026 at 9:40 PM CEST, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> Two large spi_nor_flash_parameter structures on a function stack
> is really too much, and this can exceed an otherwise reasonable
> frame limit:
>
> drivers/mtd/spi-nor/sfdp.c: In function 'spi_nor_parse_sfdp':
> drivers/mtd/spi-nor/sfdp.c:1717:1: error: the frame size of 1600 bytes is larger than 1536 bytes [-Werror=frame-larger-than=]
>
> Change one of them to a dynamic allocation to make this more reasonable.

Thanks for taking care of that. Will you respin the patch with what
David suggested?

-michael

> Fixes: d20029474a76 ("mtd: spi-nor: push the rollback mechanism into the sfdp module")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> drivers/mtd/spi-nor/sfdp.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)

Attachment: signature.asc
Description: PGP signature