mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] firmware: cs_dsp: fix missing pwr_lock in cs_dsp_signal_event_controls()
@ 2026-01-31 22:33 Ziyi Guo
  2026-02-02  9:58 ` Richard Fitzgerald
  0 siblings, 1 reply; 3+ messages in thread
From: Ziyi Guo @ 2026-01-31 22:33 UTC (permalink / raw)
  To: Simon Trimmer, Charles Keepax, Richard Fitzgerald
  Cc: patches, linux-kernel, Ziyi Guo

cs_dsp_signal_event_controls() calls cs_dsp_coeff_write_acked_control()
which has lockdep_assert_held(&dsp->pwr_lock), but the lock is not held.

Add mutex_lock()/mutex_unlock() around the control list iteration in
cs_dsp_signal_event_controls() to fix the missing lock protection.

Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
---
 drivers/firmware/cirrus/cs_dsp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 525ac0f0a75d..0067cf292c62 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -972,6 +972,8 @@ static void cs_dsp_signal_event_controls(struct cs_dsp *dsp,
 	struct cs_dsp_coeff_ctl *ctl;
 	int ret;
 
+	mutex_lock(&dsp->pwr_lock);
+
 	list_for_each_entry(ctl, &dsp->ctl_list, list) {
 		if (ctl->type != WMFW_CTL_TYPE_HOSTEVENT)
 			continue;
@@ -985,6 +987,8 @@ static void cs_dsp_signal_event_controls(struct cs_dsp *dsp,
 				    "Failed to send 0x%x event to alg 0x%x (%d)\n",
 				    event, ctl->alg_region.alg, ret);
 	}
+
+	mutex_unlock(&dsp->pwr_lock);
 }
 
 static void cs_dsp_free_ctl_blk(struct cs_dsp_coeff_ctl *ctl)
-- 
2.34.1


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

end of thread, other threads:[~2026-02-02 14:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-31 22:33 [PATCH] firmware: cs_dsp: fix missing pwr_lock in cs_dsp_signal_event_controls() Ziyi Guo
2026-02-02  9:58 ` Richard Fitzgerald
2026-02-02 14:06   ` Ziyi Guo

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

all inboxes | Powered by JetHome®