lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9742ddcaa921caa5e3ea70adcdfbe34f0a52c1cd.camel@svanheule.net>
Date: Wed, 22 Oct 2025 22:21:12 +0200
From: Sander Vanheule <sander@...nheule.net>
To: Mark Brown <broonie@...nel.org>
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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ