Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub
@ 2025-12-08  5:20 Sheetal .
  2025-12-08 20:57 ` Sander Vanheule
  2025-12-15 13:58 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Sheetal . @ 2025-12-08  5:20 UTC (permalink / raw)
  To: linux-sound, Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Thierry Reding,
	Jonathan Hunter, Charles Keepax, Sander Vanheule, linux-tegra,
	linux-kernel, sheetal

From: sheetal <sheetal@nvidia.com>

The tegra210_ahub driver started triggering a warning after commit
e062bdfdd6ad ("regmap: warn users about uninitialized flat cache"),
which flags drivers using REGCACHE_FLAT without register defaults.
Since the driver omits default definitions because its registers are
zero initialized, the following warning is shown:

  WARNING KERN tegra210-ahub 2900800.ahub: using zero-initialized flat cache, this may cause unexpected behavior

Switch to REGCACHE_FLAT_S which is the recommended cache type for
sparse register maps without defaults. This cache type initializes
entries on-demand from hardware, eliminating the warning while using
memory efficiently.

Fixes: e062bdfdd6ad ("regmap: warn users about uninitialized flat cache")
Signed-off-by: sheetal <sheetal@nvidia.com>
---
 sound/soc/tegra/tegra210_ahub.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/tegra/tegra210_ahub.c b/sound/soc/tegra/tegra210_ahub.c
index e795907a3963..261d9067d27b 100644
--- a/sound/soc/tegra/tegra210_ahub.c
+++ b/sound/soc/tegra/tegra210_ahub.c
@@ -2077,7 +2077,7 @@ static const struct regmap_config tegra210_ahub_regmap_config = {
 	.val_bits		= 32,
 	.reg_stride		= 4,
 	.max_register		= TEGRA210_MAX_REGISTER_ADDR,
-	.cache_type		= REGCACHE_FLAT,
+	.cache_type		= REGCACHE_FLAT_S,
 };
 
 static const struct regmap_config tegra186_ahub_regmap_config = {
@@ -2085,7 +2085,7 @@ static const struct regmap_config tegra186_ahub_regmap_config = {
 	.val_bits		= 32,
 	.reg_stride		= 4,
 	.max_register		= TEGRA186_MAX_REGISTER_ADDR,
-	.cache_type		= REGCACHE_FLAT,
+	.cache_type		= REGCACHE_FLAT_S,
 };
 
 static const struct regmap_config tegra264_ahub_regmap_config = {
@@ -2094,7 +2094,7 @@ static const struct regmap_config tegra264_ahub_regmap_config = {
 	.reg_stride		= 4,
 	.writeable_reg		= tegra264_ahub_wr_reg,
 	.max_register		= TEGRA264_MAX_REGISTER_ADDR,
-	.cache_type		= REGCACHE_FLAT,
+	.cache_type		= REGCACHE_FLAT_S,
 };
 
 static const struct tegra_ahub_soc_data soc_data_tegra210 = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub
  2025-12-08  5:20 [PATCH] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub Sheetal .
@ 2025-12-08 20:57 ` Sander Vanheule
  2025-12-09  1:01   ` Mark Brown
  2025-12-15 13:58 ` Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Sander Vanheule @ 2025-12-08 20:57 UTC (permalink / raw)
  To: Sheetal ., linux-sound, Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Thierry Reding,
	Jonathan Hunter, Charles Keepax, linux-tegra, linux-kernel

Hi,

On Mon, 2025-12-08 at 10:50 +0530, Sheetal . wrote:
> From: sheetal <sheetal@nvidia.com>
> 
> The tegra210_ahub driver started triggering a warning after commit
> e062bdfdd6ad ("regmap: warn users about uninitialized flat cache"),
> which flags drivers using REGCACHE_FLAT without register defaults.
> Since the driver omits default definitions because its registers are
> zero initialized, the following warning is shown:
> 
>   WARNING KERN tegra210-ahub 2900800.ahub: using zero-initialized flat cache,
> this may cause unexpected behavior
> 
> Switch to REGCACHE_FLAT_S which is the recommended cache type for
> sparse register maps without defaults. This cache type initializes
> entries on-demand from hardware, eliminating the warning while using
> memory efficiently.
> 
> Fixes: e062bdfdd6ad ("regmap: warn users about uninitialized flat cache")

I disagree with this tag. The commit is working as intended by giving a warning.

This device's reset state happens to match the zero-initialization of the flat
cache, so there were no issues here. An earlier version of this sparse flat
cache indicated a potential problem with another driver, so there are likely
drivers out there that do need fixing:

https://lore.kernel.org/all/a2f7e2c3-f072-40f7-a865-5693b82b636e@sirena.org.uk/


Regardless, this patch could still be material for 6.19 to avoid unneeded
warnings, but that's up to Mark.

Best,
Sander

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub
  2025-12-08 20:57 ` Sander Vanheule
@ 2025-12-09  1:01   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2025-12-09  1:01 UTC (permalink / raw)
  To: Sander Vanheule
  Cc: Sheetal ., linux-sound, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, Thierry Reding, Jonathan Hunter, Charles Keepax,
	linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]

On Mon, Dec 08, 2025 at 09:57:01PM +0100, Sander Vanheule wrote:
> On Mon, 2025-12-08 at 10:50 +0530, Sheetal . wrote:

> > The tegra210_ahub driver started triggering a warning after commit
> > e062bdfdd6ad ("regmap: warn users about uninitialized flat cache"),
> > which flags drivers using REGCACHE_FLAT without register defaults.
> > Since the driver omits default definitions because its registers are
> > zero initialized, the following warning is shown:
> > 
> >   WARNING KERN tegra210-ahub 2900800.ahub: using zero-initialized flat cache,
> > this may cause unexpected behavior

> > Switch to REGCACHE_FLAT_S which is the recommended cache type for
> > sparse register maps without defaults. This cache type initializes
> > entries on-demand from hardware, eliminating the warning while using
> > memory efficiently.

Like Sander says we can't just do this without checking that the driver
isn't relying on the fact that the cache ends up defaulting to zero
initialisation, that's the whole reason there are two separate cache
types here.

> > Fixes: e062bdfdd6ad ("regmap: warn users about uninitialized flat cache")

> I disagree with this tag. The commit is working as intended by giving a warning.

Yes.

> This device's reset state happens to match the zero-initialization of the flat
> cache, so there were no issues here. An earlier version of this sparse flat
> cache indicated a potential problem with another driver, so there are likely
> drivers out there that do need fixing:

The driver could also just provide the defaults FWIW but there's likely
to be little practical difference.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub
  2025-12-08  5:20 [PATCH] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub Sheetal .
  2025-12-08 20:57 ` Sander Vanheule
@ 2025-12-15 13:58 ` Mark Brown
  2025-12-16 10:36   ` Sheetal .
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Brown @ 2025-12-15 13:58 UTC (permalink / raw)
  To: linux-sound, Sheetal .
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Thierry Reding,
	Jonathan Hunter, Charles Keepax, Sander Vanheule, linux-tegra,
	linux-kernel

On Mon, 08 Dec 2025 10:50:40 +0530, Sheetal . wrote:
> The tegra210_ahub driver started triggering a warning after commit
> e062bdfdd6ad ("regmap: warn users about uninitialized flat cache"),
> which flags drivers using REGCACHE_FLAT without register defaults.
> Since the driver omits default definitions because its registers are
> zero initialized, the following warning is shown:
> 
>   WARNING KERN tegra210-ahub 2900800.ahub: using zero-initialized flat cache, this may cause unexpected behavior
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub
      commit: 4d4021b0bbd1fad7c72b9155863f5b3ccb43ae91

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub
  2025-12-15 13:58 ` Mark Brown
@ 2025-12-16 10:36   ` Sheetal .
  2025-12-17 10:37     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Sheetal . @ 2025-12-16 10:36 UTC (permalink / raw)
  To: Mark Brown, linux-sound
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Thierry Reding,
	Jonathan Hunter, Charles Keepax, Sander Vanheule, linux-tegra,
	linux-kernel

Hi Mark,

This patch is causing issues with the tegra AHUB driver. Could you 
please drop it, or should I send a revert?

Thanks,
Sheetal

On 15-12-2025 19:28, Mark Brown wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Mon, 08 Dec 2025 10:50:40 +0530, Sheetal . wrote:
>> The tegra210_ahub driver started triggering a warning after commit
>> e062bdfdd6ad ("regmap: warn users about uninitialized flat cache"),
>> which flags drivers using REGCACHE_FLAT without register defaults.
>> Since the driver omits default definitions because its registers are
>> zero initialized, the following warning is shown:
>>
>>    WARNING KERN tegra210-ahub 2900800.ahub: using zero-initialized flat cache, this may cause unexpected behavior
>>
>> [...]
> 
> Applied to
> 
>     https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
> 
> Thanks!
> 
> [1/1] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub
>        commit: 4d4021b0bbd1fad7c72b9155863f5b3ccb43ae91
> 
> All being well this means that it will be integrated into the linux-next
> tree (usually sometime in the next 24 hours) and sent to Linus during
> the next merge window (or sooner if it is a bug fix), however if
> problems are discovered then the patch may be dropped or reverted.
> 
> You may get further e-mails resulting from automated or manual testing
> and review of the tree, please engage with people reporting problems and
> send followup patches addressing any issues that are reported if needed.
> 
> If any updates are required or you are submitting further changes they
> should be sent as incremental updates against current git, existing
> patches will not be replaced.
> 
> Please add any relevant lists and maintainers to the CCs when replying
> to this mail.
> 
> Thanks,
> Mark
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub
  2025-12-16 10:36   ` Sheetal .
@ 2025-12-17 10:37     ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2025-12-17 10:37 UTC (permalink / raw)
  To: Sheetal .
  Cc: linux-sound, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Thierry Reding, Jonathan Hunter, Charles Keepax, Sander Vanheule,
	linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

On Tue, Dec 16, 2025 at 04:06:53PM +0530, Sheetal . wrote:

Please don't top post, reply in line with needed context.  This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.

> This patch is causing issues with the tegra AHUB driver. Could you please
> drop it, or should I send a revert?

As covered in the mail you are replying to:

> > If any updates are required or you are submitting further changes they
> > should be sent as incremental updates against current git, existing
> > patches will not be replaced.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-12-17 10:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08  5:20 [PATCH] ASoC: tegra: Fix uninitialized flat cache warning in tegra210_ahub Sheetal .
2025-12-08 20:57 ` Sander Vanheule
2025-12-09  1:01   ` Mark Brown
2025-12-15 13:58 ` Mark Brown
2025-12-16 10:36   ` Sheetal .
2025-12-17 10:37     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox