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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZWo45hiK-n8W_yWJ@camel3.lan>
Date:   Fri, 1 Dec 2023 20:49:58 +0100
From:   Matthias Reichl <hias@...us.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Mark Brown <broonie@...nel.org>
Cc:     linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
        torvalds@...ux-foundation.org, stable@...r.kernel.org,
        jslaby@...e.cz
Subject: Re: Linux 6.6.3

On Tue, Nov 28, 2023 at 06:27:10PM +0000, Greg Kroah-Hartman wrote:
> Mark Brown (1):
>       regmap: Ensure range selector registers are updated after cache sync

This commit caused a regression, accessing a pcm512x based soundcard now
fails with EINVAL and dmesg shows sync cache and pm_runtime_get errors:

# speaker-test -D hw:CARD=PCM5122,DEV=0 -c 2 -t sine
speaker-test 1.1.8

Playback device is hw:CARD=PCM5122,DEV=0
Stream parameters are 48000Hz, S16_LE, 2 channels
Sine wave rate is 440.0000Hz
Playback open error: -22,Invalid argument
# dmesg | grep pcm512x
[  228.794676] pcm512x 1-004c: Failed to sync cache: -22
[  228.794740] pcm512x 1-004c: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004c: -22

We initially noticed that on the downstream RPi kernels 6.6.3 and
6.1.64 https://github.com/raspberrypi/linux/issues/5763 and
I now reproduced that with vanilla 6.6.3 running on a RPi2
(multi_v7_defconfig plus CONFIG_SND_SOC_PCM512x_I2C and a pcm5122
soundcard with simple-audio-card driver).

Reverting the commit fixes the issue.

I'm not familiar with the regcache code but it looks a bit like the
return value from the regcache_read check is leaking out - not
assigning the value to ret seems to resolve the issue, too
(no idea though if that would be the correct fix):

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 92592f944a3df..ac63a73ccdaaa 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -410,8 +410,7 @@ int regcache_sync(struct regmap *map)
 			rb_entry(node, struct regmap_range_node, node);
 
 		/* If there's nothing in the cache there's nothing to sync */
-		ret = regcache_read(map, this->selector_reg, &i);
-		if (ret != 0)
+		if (regcache_read(map, this->selector_reg, &i) != 0)
 			continue;
 
 		ret = _regmap_write(map, this->selector_reg, i);

so long,

Hias

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ