[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCtkSBZfkc2k1jnb@shikoro>
Date: Mon, 19 May 2025 19:03:04 +0200
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: Jian Zhang <zhangjian.3032@...edance.com>
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2c: slave-eeprom: add latch mode
On Mon, Dec 09, 2024 at 02:04:21PM +0800, Jian Zhang wrote:
> The read operation is locked by byte, while the write operation is
> locked by block (or based on the amount of data written). If we need to
> ensure the integrity of a "block" of data that the other end can read,
> then we need a latch mode, lock the buffer when a read operation is
> requested.
I don't really understand what you want to fix here. Does this patch
really fix your issue because...
> switch (event) {
> case I2C_SLAVE_WRITE_RECEIVED:
> + if (eeprom->latch) {
> + spin_lock(&eeprom->buffer_lock);
> + memcpy(eeprom->buffer_latch, eeprom->buffer, eeprom->bin.size);
> + spin_unlock(&eeprom->buffer_lock);
> + }
... what advantage brings you this memcpy of the buffer to a latch after
every single byte is received?
> + if (of_property_read_bool(client->adapter->dev.of_node, "use-latch")) {
If there really is a problem, we don't need a binding for it but should
use the fix in all cases.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists