Skip to contentSkip to conversation

Patch "ASoC: wm_adsp: Return an error on write to a disabled volatile control" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Oct 5, 2017

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ASoC: wm_adsp: Return an error on write to a disabled volatile control

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
asoc-wm_adsp-return-an-error-on-write-to-a-disabled-volatile-control.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Oct 5 10:28:31 CEST 2017

From: Charles Keepax <[email protected]>
Date: Mon, 6 Mar 2017 16:54:33 +0000
Subject: ASoC: wm_adsp: Return an error on write to a disabled volatile control

From: Charles Keepax <[email protected]>

[ Upstream commit 67430a39ca7a6af28aade5acb92d43ee257c1014 ]

Volatile controls should only be accessed when the firmware is active, currently however writes to these controls will succeed, but the data will be lost, if the firmware is powered down. Update this behaviour such that an error is returned the same as it is for reads.

---
 sound/soc/codecs/wm_adsp.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
sound/soc/codecs/wm_adsp.c +6 -1
@@ -789,7 +789,10 @@ static int wm_coeff_put(struct snd_kcont
 
 	mutex_lock(&ctl->dsp->pwr_lock);
 
-	memcpy(ctl->cache, p, ctl->len);
+	if (ctl->flags & WMFW_CTL_FLAG_VOLATILE)
+		ret = -EPERM;
+	else
+		memcpy(ctl->cache, p, ctl->len);
 
 	ctl->set = 1;
 	if (ctl->enabled && ctl->dsp->running)
@@ -816,6 +819,8 @@ static int wm_coeff_tlv_put(struct snd_k
 		ctl->set = 1;
 		if (ctl->enabled && ctl->dsp->running)
 			ret = wm_coeff_write_control(ctl, ctl->cache, size);
+		else if (ctl->flags & WMFW_CTL_FLAG_VOLATILE)
+			ret = -EPERM;
 	}
 
 	mutex_unlock(&ctl->dsp->pwr_lock);

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/asoc-wm_adsp-return-an-error-on-write-to-a-disabled-volatile-control.patch