Skip to contentSkip to conversation

ASoC: rt1320: make SRAM registers readable to stop being cached

PATCH Superseded [email protected] 2 participants 3 messages Sep 21 – Sep 24

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: rt1320: make SRAM registers readable to stop being cached

From: Jack Yu <[email protected]>

rt1320_volatile_register() lists the SRAM ranges 0x10000000-0x10008fff and 0x1000c000-0x1000dfff as volatile, so they should never be cached. But regmap only honors the volatile flag for a readable register, and these ranges were missing from rt1320_readable_register(). They were therefore cached at probe and
replayed over SoundWire on every runtime resume, delaying the first PCM open after autosuspend by about a second.

Add the two ranges to rt1320_readable_register() so the volatile flag takes effect and the SRAM is no longer cached or replayed. The removed lines are already covered by the
new 0x1000c000-0x1000dfff range, so no register loses readability.

---
 sound/soc/codecs/rt1320-sdw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/rt1320-sdw.c +2 -2
index b13622e54ae0..6863c5ec9428 100644
@@ -890,8 +890,8 @@ static bool rt1320_readable_register(struct device *dev, unsigned int reg)
 	case 0xf01e:
 	case 0xf717 ... 0xf719:
 	case 0xf720 ... 0xf723:
-	case 0x1000cd91 ... 0x1000cd96:
-	case RT1321_PATCH_MAIN_VER ... RT1321_PATCH_BETA_VER:
+	case 0x10000000 ... 0x10008fff:
+	case 0x1000c000 ... 0x1000dfff:
 	case 0x1000f008:
 	case 0x1000f021:
 	case 0x20003000 ... 0x2000300f:
Signature · 1 line
2.54.0
maintainer
#1 lore raw
Quoted 10 lines · On Mon, Sep 21, 2026 at 03:28:47PM +0800, [email protected] wrote:

From: Jack Yu <[email protected]>

rt1320_volatile_register() lists the SRAM ranges 0x10000000-0x10008fff and 0x1000c000-0x1000dfff as volatile, so they should never be cached. But regmap only honors the volatile flag for a readable register, and these ranges were missing from rt1320_readable_register(). They were therefore cached at probe and
replayed over SoundWire on every runtime resume, delaying the first PCM open after autosuspend by about a second.

Quoted 4 lines

Add the two ranges to rt1320_readable_register() so the volatile flag takes effect and the SRAM is no longer cached or replayed. The removed lines are already covered by the
new 0x1000c000-0x1000dfff range, so no register loses readability.

The RAE loader seems to expect that 0x1000d000-0x1000d7ff is cached, or at least it's fiddling with the cache bypass for that range.

author
#2 lore raw
Quoted 23 lines

-----Original Message-----
From: Mark Brown <[email protected]>
Sent: Monday, September 21, 2026 5:11 PM
To: Jack Yu <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Flove(HsinFu) <[email protected]>; Oder Chiou <[email protected]>; Shuming [范書銘] <[email protected]>; Derek [方德義] <[email protected]>
Subject: Re: [PATCH] ASoC: rt1320: make SRAM registers readable to stop being cached

Quoted 10 lines · On Mon, Sep 21, 2026 at 03:28:47PM +0800, [email protected] wrote:

From: Jack Yu <[email protected]>

rt1320_volatile_register() lists the SRAM ranges 0x10000000-0x10008fff and 0x1000c000-0x1000dfff as volatile, so they should never be cached. But regmap only honors the volatile flag for a readable register, and these ranges were missing from rt1320_readable_register(). They were therefore cached at probe and replayed over SoundWire on every runtime resume, delaying the first PCM open after autosuspend by about a second.

Quoted 6 lines
Quoted 4 lines

Add the two ranges to rt1320_readable_register() so the volatile flag takes effect and the SRAM is no longer cached or replayed. The removed lines are already covered by the new 0x1000c000-0x1000dfff range, so no register loses readability.

The RAE loader seems to expect that 0x1000d000-0x1000d7ff is cached, or at

Thanks for reminding this, I'll exclude this range 0x1000d000-0x1000d7ff out of the volatile registers.

Quoted 1 line

least it's fiddling with the cache bypass for that range.