alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: rt700: wait for the delayed work to finish when the system suspends
@ 2020-09-21  9:42 shumingf
  2020-09-21 14:29 ` Pierre-Louis Bossart
  0 siblings, 1 reply; 2+ messages in thread
From: shumingf @ 2020-09-21  9:42 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, mengdong.lin, derek.fang,
	Shuming Fan, flove, pierre-louis.bossart

From: Shuming Fan <shumingf@realtek.com>

To avoid the IO error, we need to cancel the delayed work and wait for it to finish.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
---
 sound/soc/codecs/rt700-sdw.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/codecs/rt700-sdw.c b/sound/soc/codecs/rt700-sdw.c
index ead4918bbf90..c7deb4e4fcf1 100644
--- a/sound/soc/codecs/rt700-sdw.c
+++ b/sound/soc/codecs/rt700-sdw.c
@@ -490,6 +490,9 @@ static int __maybe_unused rt700_dev_suspend(struct device *dev)
 	if (!rt700->hw_init)
 		return 0;
 
+	cancel_delayed_work_sync(&rt700->jack_detect_work);
+	cancel_delayed_work_sync(&rt700->jack_btn_check_work);
+
 	regcache_cache_only(rt700->regmap, true);
 
 	return 0;
-- 
2.28.0


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

* Re: [PATCH 1/2] ASoC: rt700: wait for the delayed work to finish when the system suspends
  2020-09-21  9:42 [PATCH 1/2] ASoC: rt700: wait for the delayed work to finish when the system suspends shumingf
@ 2020-09-21 14:29 ` Pierre-Louis Bossart
  0 siblings, 0 replies; 2+ messages in thread
From: Pierre-Louis Bossart @ 2020-09-21 14:29 UTC (permalink / raw)
  To: shumingf, broonie, lgirdwood
  Cc: oder_chiou, jack.yu, alsa-devel, lars, mengdong.lin, derek.fang,
	flove, pierre-louis.bossart



On 9/21/20 4:42 AM, shumingf@realtek.com wrote:
> From: Shuming Fan <shumingf@realtek.com>
> 
> To avoid the IO error, we need to cancel the delayed work and wait for it to finish.
> 
> Signed-off-by: Shuming Fan <shumingf@realtek.com>

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> ---
>   sound/soc/codecs/rt700-sdw.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/sound/soc/codecs/rt700-sdw.c b/sound/soc/codecs/rt700-sdw.c
> index ead4918bbf90..c7deb4e4fcf1 100644
> --- a/sound/soc/codecs/rt700-sdw.c
> +++ b/sound/soc/codecs/rt700-sdw.c
> @@ -490,6 +490,9 @@ static int __maybe_unused rt700_dev_suspend(struct device *dev)
>   	if (!rt700->hw_init)
>   		return 0;
>   
> +	cancel_delayed_work_sync(&rt700->jack_detect_work);
> +	cancel_delayed_work_sync(&rt700->jack_btn_check_work);
> +
>   	regcache_cache_only(rt700->regmap, true);
>   
>   	return 0;
> 

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

end of thread, other threads:[~2020-09-21 16:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-21  9:42 [PATCH 1/2] ASoC: rt700: wait for the delayed work to finish when the system suspends shumingf
2020-09-21 14:29 ` Pierre-Louis Bossart

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).