* [PATCH] ALSA: hda: cs35l56: Fix lifecycle of codec pointer
@ 2024-05-31 11:27 Simon Trimmer
2024-05-31 12:39 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Simon Trimmer @ 2024-05-31 11:27 UTC (permalink / raw)
To: tiwai; +Cc: linux-sound, alsa-devel, linux-kernel, patches, Simon Trimmer
The codec should be cleared when the amp driver is unbound and when
resuming it should be tested to prevent loading firmware into the device
and ALSA in a partially configured system state.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
---
sound/pci/hda/cs35l56_hda.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
index 11b0570ff56d..0923e2589f5f 100644
--- a/sound/pci/hda/cs35l56_hda.c
+++ b/sound/pci/hda/cs35l56_hda.c
@@ -735,6 +735,8 @@ static void cs35l56_hda_unbind(struct device *dev, struct device *master, void *
if (comps[cs35l56->index].dev == dev)
memset(&comps[cs35l56->index], 0, sizeof(*comps));
+ cs35l56->codec = NULL;
+
dev_dbg(cs35l56->base.dev, "Unbound\n");
}
@@ -840,6 +842,9 @@ static int cs35l56_hda_system_resume(struct device *dev)
cs35l56->suspended = false;
+ if (!cs35l56->codec)
+ return 0;
+
ret = cs35l56_is_fw_reload_needed(&cs35l56->base);
dev_dbg(cs35l56->base.dev, "fw_reload_needed: %d\n", ret);
if (ret > 0) {
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: hda: cs35l56: Fix lifecycle of codec pointer
2024-05-31 11:27 [PATCH] ALSA: hda: cs35l56: Fix lifecycle of codec pointer Simon Trimmer
@ 2024-05-31 12:39 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2024-05-31 12:39 UTC (permalink / raw)
To: Simon Trimmer; +Cc: tiwai, linux-sound, alsa-devel, linux-kernel, patches
On Fri, 31 May 2024 13:27:16 +0200,
Simon Trimmer wrote:
>
> The codec should be cleared when the amp driver is unbound and when
> resuming it should be tested to prevent loading firmware into the device
> and ALSA in a partially configured system state.
>
> Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Thanks, applied.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-31 12:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-31 11:27 [PATCH] ALSA: hda: cs35l56: Fix lifecycle of codec pointer Simon Trimmer
2024-05-31 12:39 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox