Re: [PATCH] regcache: Warn if regcache_sync() is called in cache_only mode
From: Mark Brown
Date: Thu Jul 16 2026 - 08:52:33 EST
On Thu, Jul 16, 2026 at 05:06:12PM +0700, Bui Duc Phuc wrote:
> On top of that, I'd like to ask about a design question:
> Should regcache_sync() set map->cache_only = true again if it fails
> partway through,
> or should we leave it to the caller to call regcache_cache_only() themselves?
That's for the caller.
> If we leave it to the caller, should we also update the function's
> documentation
> to make clear that after a failed sync, the state of the registers is no longer
> guaranteed to match the cache, and that further register access should be
> done carefully , and that calling regcache_cache_only() is recommended to
> keep the device in a safe/consistent state?
I'd have hoped it'd be fairly obvious that the device is in an
indeterminate state after a failed sync, TBH if I/O isn't working
recovery options are going to be *super* limited.
Attachment:
signature.asc
Description: PGP signature