Attention is currently required from: Angel Pons, Arthur Heymans, Elyes Haouas, Felix Held, Nico Huber.
Julius Werner has posted comments on this change by Arthur Heymans. ( https://review.coreboot.org/c/coreboot/+/84059?usp=email )
Change subject: drivers/spi: Stop using a variable-length array, 2nd try ......................................................................
Patch Set 3:
(3 comments)
File src/drivers/spi/spi_flash.c:
https://review.coreboot.org/c/coreboot/+/84059/comment/91ecca98_9c02fbc6?usp... : PS1, Line 317: chunk_len = MIN(MAX_FLASH_CMD_DATA_SIZE, chunk_len);
Seems fine to me. The caller of spi_flash_cmd_write_page_program(), and […]
Why is this line still necessary when we've already checked that no page_size can be larger than 256?
If you're worried that this might change in the future, it would be nice if we could have a compile time check instead. Maybe we can wrap all spi_flash_vendor_info struct definitions in a macro that adds a _Static_assert() for the page_size_shift?
File src/drivers/spi/spi_flash.c:
https://review.coreboot.org/c/coreboot/+/84059/comment/8c42650c_32d7b0e1?usp... : PS3, Line 136: /* Put the buffer in .bss to not put strain on the stack (it's limited in SMM) */ Too limited for 256 bytes? Maybe it's worth adding a STATIC_IN_SMM macro to not eat the extra stage size everywhere else (some pre-RAM stages on some platforms are also counting the bytes...)?
https://review.coreboot.org/c/coreboot/+/84059/comment/8714cd78_73fd19ff?usp... : PS3, Line 140: return -1; assert()?