From: Sander Vanheule <sander@svanheule.net>
To: Mark Brown <broonie@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] regmap: add cache validity to REGCACHE_FLAT
Date: Wed, 22 Oct 2025 22:21:12 +0200 [thread overview]
Message-ID: <9742ddcaa921caa5e3ea70adcdfbe34f0a52c1cd.camel@svanheule.net> (raw)
In-Reply-To: <26abcd6d-ae3a-4ef8-890a-9b209c3c8e03@sirena.org.uk>
Hi Mark,
On Fri, 2025-10-17 at 14:56 +0100, Mark Brown wrote:
> On Thu, Oct 16, 2025 at 10:49:40PM +0200, Sander Vanheule wrote:
> > Some quick grepping turned up 35 drivers which use REGCACHE_FLAT without any
> > cache initialization (see below), thus defaulting to the all-zero cache. This
> > includes the driver I think you found issues with on the pine64: sun8i-codec.c
> > If this driver (accidentally) relies on the zero-initialization, I would expect
> > the spurious interrupts to also pop up when switching to a maple cache, or when
> > using the num_reg_defaults_raw workaround.
>
> Yes, that driver is relying on the current behaviour - I'd expect at
> least some of the other drivers are too.
>
> There's two separate things here, there's what the driver you're working
> on should do (which is to use a maple tree cache from the sounds of it)
> and there's potential improvements to the flat cache, or adding a new
> sparse flat cache.
For my driver I went with a maple cache, as that's the one I can get functional.
Meanwhile, I also noticed others on the linux-gpio list being unaware of the pitfalls of
the flat cache [1]. So I decided to send a v4 [2] of this patch, albeit split up in a new
flat-sparse variant and a warning for the current flat cache. Even with clearer
documentation on the limitations of the flat cache, devs/reviewers/maintainers would need
to be aware. I feel like it's better to just have less surprises.
[1] https://lore.kernel.org/linux-gpio/e461ca08-ad28-44fe-85f1-afe332c1d43d@topic.nl/
[2] https://lore.kernel.org/lkml/20251022200408.63027-1-sander@svanheule.net/T/
Best,
Sander
prev parent reply other threads:[~2025-10-22 20:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 18:02 Sander Vanheule
2025-01-09 20:11 ` Mark Brown
2025-10-16 8:46 ` Sander Vanheule
2025-10-16 11:53 ` Mark Brown
2025-10-16 12:08 ` Sander Vanheule
2025-10-16 13:55 ` Mark Brown
2025-10-16 20:49 ` Sander Vanheule
2025-10-17 13:56 ` Mark Brown
2025-10-22 20:21 ` Sander Vanheule [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9742ddcaa921caa5e3ea70adcdfbe34f0a52c1cd.camel@svanheule.net \
--to=sander@svanheule.net \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®