alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH] ASoC: core: only flush inited work during free
@ 2019-11-28  1:13 Curtis Malainey
  2019-11-28  6:39 ` Takashi Iwai
  2019-12-09 18:59 ` [alsa-devel] Applied "ASoC: core: only flush inited work during free" to the asoc tree Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Curtis Malainey @ 2019-11-28  1:13 UTC (permalink / raw)
  To: alsa-devel; +Cc: Curtis Malainey, Mark Brown, Takashi Iwai, Liam Girdwood

There are many paths to soc_free_pcm_runtime which can both have and
have not yet inited the workqueue yet. When we flush the queue when we
have not yet inited the queue we cause warnings to be printed.

An example is soc_cleanup_card_resources which is called by
snd_soc_bind_card which has multiple failure points before and after
soc_link_init -> soc_new_pcm which is where the queue is inited.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
---
 sound/soc/soc-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 062653ab03a37..3bf702b874a6d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -419,7 +419,8 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd)
 
 	list_del(&rtd->list);
 
-	flush_delayed_work(&rtd->delayed_work);
+	if (delayed_work_pending(&rtd->delayed_work))
+		flush_delayed_work(&rtd->delayed_work);
 	snd_soc_pcm_component_free(rtd);
 
 	/*
-- 
2.24.0.393.g34dc348eaf-goog

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2019-12-09 19:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-28  1:13 [alsa-devel] [PATCH] ASoC: core: only flush inited work during free Curtis Malainey
2019-11-28  6:39 ` Takashi Iwai
2019-11-28 13:49   ` Mark Brown
2019-11-28 16:23     ` Curtis Malainey
2019-11-28 17:28       ` Mark Brown
2019-12-02 22:50         ` Curtis Malainey
2019-12-09 18:59 ` [alsa-devel] Applied "ASoC: core: only flush inited work during free" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).