Attention is currently required from: Angel Pons, Jacob Garber. Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/50480 )
Change subject: drivers/spi: Stop using a variable-length array ......................................................................
Patch Set 1:
(1 comment)
File src/drivers/spi/spi_flash.c:
https://review.coreboot.org/c/coreboot/+/50480/comment/8ac20154_95c70ad1 PS1, Line 95: u8 buff[4 + (1 << DEFAULT_PAGE_SIZE_SHIFT)];
I made CB:50519 to avoid having to concatenate buffers inside this function. […]
I mean, I don't really see how that would be an issue with what I suggested? I think it makes sense to assume the command length cannot go beyond 4 bytes, same as you did in the patch here. I'm just saying make up a reasonable maximum number for the data length (e.g. 256), make sure that number doesn't get exceeded in all relevant callers (seems to only be spi_flash_cmd_write_page_program() for now), and then allocate an array of 4 + 256 bytes to hold the combined transfer here.