[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <143f0597-7cfa-4b16-ada9-72922f566284@sirena.org.uk>
Date: Thu, 16 Oct 2025 14:55:32 +0100
From: Mark Brown <broonie@...nel.org>
To: Sander Vanheule <sander@...nheule.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] regmap: add cache validity to REGCACHE_FLAT
On Thu, Oct 16, 2025 at 02:08:41PM +0200, Sander Vanheule wrote:
> On Thu, 2025-10-16 at 12:53 +0100, Mark Brown wrote:
> > Taking a step back for a minute, what's the actual problem you're trying
> > to solve here? Why use a flat cache rather than a maple tree cache for
> > your application?
> The device I want to use this for has a small contiguous register space, so a
> flat cache should be sufficient. The driver can also works with maple (or RB-
> tree) cache.
I strongly recommend just doing that, unless you have a specific need to
use something else you should use a maple tree cache.
> This difference in caching behavior isn't (wasn't) immediately clear to me from
> the documentation. Don't the different cache types exist to optimize speed or
> memory for different use-cases? Because then I would only expect differences in
> memory/speed, not in way the cache is initialized.
The flat cache is a bit of a sharp edge, it's specifically there to be
the absolute bare minimum cache. It's there mainly for MMIO devices
that are on the edge of being able to use regmap at all for performance
reasons, and as a simple way of guaranteeing that we never do any
allocations at runtime for things that do register access in hardirq
context.
The documentation could definitely use some improvement here.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists