Re: [PATCH] eeprom: at24: wait for write cycle before releasing runtime PM
From: Kristian Otnes (kotnes)
Date: Sun Nov 29 2026 - 05:15:32 EST
Hi Greg,
Greg wrote:
> There is no context here :(
I apologize that my previous message lacked context and was poorly
formatted.
I am referring to Daniel's email of 26 November 2026, with the subject
"[PATCH] eeprom: at24: wait for write cycle before releasing runtime PM".
The patch reads the last written byte before releasing the runtime PM
reference. This uses the driver's existing retry mechanism to wait for
the EEPROM to respond.
My question is about the behavior and trade-off, rather than an
objection to fixing the reported data-loss case.
The driver is based on the principle of retries prior to write or
read in case the EEPROM is still busy with a previous write cycle.
One possible reason for this behavior is to avoid making the
caller wait for the final write cycle. This may have been an
intentional latency optimization. The proposed change would
keep at24_write() from returning successfully until the final write
cycle completes. Is that an acceptable trade-off for the suggested
patch?
Could this failure instead be addressed in the runtime PM handling?
Since it was introduced by adding runtime PM support, autosuspend
could preserve the driver's existing write behavior. For example,
the autosuspend delay could be set to at24_write_timeout, with
at24_write() using pm_runtime_put_autosuspend(). If this seems
preferable, that alternative would require a new patch proposal
with additional runtime PM changes to configure and use autosuspend.
Regards,
Kristian