[PATCH v4] misc: i2c_eeprom: consider pagesize when writing to eeprom

Tom Rini trini at konsulko.com
Mon Oct 30 22:36:05 CET 2023


On Thu, Oct 26, 2023 at 05:47:41AM +0000, Michel Alex wrote:

> Calculate the maximum length of the buffer when writing
> across the page boundary. If the buffer length (len)
> exceeds the page boundary (pagesize), split it. Use this
> length instead of comparing the length with the pagesize,
> because if the write start address (offset) is not at the
> beginning of a page and the page_offset + len is greater
> than the page boundary (pagesize), the write operation
> would overflow the current page and the behaviour can be
> undefined (e.g. at24).
> 
> Signed-off-by: Alex Michel <alex.michel at wiedemann-group.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231030/2f134441/attachment.sig>


More information about the U-Boot mailing list