All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: shumingf@realtek.com, broonie@kernel.org, lgirdwood@gmail.com
Cc: oder_chiou@realtek.com, jack.yu@realtek.com,
	alsa-devel@alsa-project.org, lars@metafoo.de,
	mengdong.lin@intel.com, derek.fang@realtek.com,
	flove@realtek.com, pierre-louis.bossart@intel.com
Subject: Re: [PATCH 2/2] ASoC: rt711: wait for the delayed work to finish when the system suspends
Date: Mon, 21 Sep 2020 09:29:22 -0500	[thread overview]
Message-ID: <d0eb4e8b-49b0-bc6d-2e7d-34b51d547966@linux.intel.com> (raw)
In-Reply-To: <20200921094308.31921-1-shumingf@realtek.com>



On 9/21/20 4:43 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>

Thanks Shuming.

For more context we detected a timeout error during suspend-resume 
stress tests, the problem is similar to an earlier case with interrupt 
handling already fixed in the SoundWire tree: we want all workqueues to 
complete before suspending.

BugLink: https://github.com/thesofproject/linux/issues/2443
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> ---
>   sound/soc/codecs/rt711-sdw.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c
> index 28d663673320..3a8ca600d1cf 100644
> --- a/sound/soc/codecs/rt711-sdw.c
> +++ b/sound/soc/codecs/rt711-sdw.c
> @@ -491,6 +491,10 @@ static int __maybe_unused rt711_dev_suspend(struct device *dev)
>   	if (!rt711->hw_init)
>   		return 0;
>   
> +	cancel_delayed_work_sync(&rt711->jack_detect_work);
> +	cancel_delayed_work_sync(&rt711->jack_btn_check_work);
> +	cancel_work_sync(&rt711->calibration_work);
> +
>   	regcache_cache_only(rt711->regmap, true);
>   
>   	return 0;
> 

      reply	other threads:[~2020-09-21 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21  9:43 [PATCH 2/2] ASoC: rt711: wait for the delayed work to finish when the system suspends shumingf
2020-09-21 14:29 ` Pierre-Louis Bossart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0eb4e8b-49b0-bc6d-2e7d-34b51d547966@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=derek.fang@realtek.com \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=mengdong.lin@intel.com \
    --cc=oder_chiou@realtek.com \
    --cc=pierre-louis.bossart@intel.com \
    --cc=shumingf@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.