mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jaroslav Kysela <perex@perex.cz>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH 09/30] sound: don't use flush_scheduled_work()
Date: Sun, 12 Dec 2010 09:56:23 +0100	[thread overview]
Message-ID: <s5hk4jfbc94.wl%tiwai@suse.de> (raw)
In-Reply-To: <1292086307-19211-10-git-send-email-tj@kernel.org>

At Sat, 11 Dec 2010 17:51:26 +0100,
Tejun Heo wrote:
> 
> flush_scheduled_work() is deprecated and scheduled to be removed.
> 
> * cancel[_delayed]_work() + flush_scheduled_work() ->
>   cancel[_delayed]_work_sync().
> 
> * wm8350, wm8753 and soc-core use custom code to cancel a delayed
>   work, execute it immediately if it was pending and wait for its
>   completion.  This is equivalent to flush_delayed_work_sync().  Use
>   it instead.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: Jaroslav Kysela <perex@perex.cz>
> ---
> This is part of a series to remove flush_scheduled_work() usage to
> prepare for deprecation of flush_scheduled_work().  Patches in this
> series are self contained and mostly straight-forward.
> 
> Please feel free to take it into the appropriate tree, or just ack it.
> In the latter case, I'll merge the patch through the workqueue tree
> during the next merge window.

The most of parts look OK to me, but I'm not sure about ASoC changes,
e.g. below one:

> diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
> index 7611add..b3e9fac 100644
> --- a/sound/soc/codecs/wm8350.c
> +++ b/sound/soc/codecs/wm8350.c
> @@ -1626,7 +1626,6 @@ static int  wm8350_codec_remove(struct snd_soc_codec *codec)
>  {
>  	struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec);
>  	struct wm8350 *wm8350 = dev_get_platdata(codec->dev);
> -	int ret;
>  
>  	wm8350_clear_bits(wm8350, WM8350_JACK_DETECT,
>  			  WM8350_JDL_ENA | WM8350_JDR_ENA);
> @@ -1641,15 +1640,9 @@ static int  wm8350_codec_remove(struct snd_soc_codec *codec)
>  	priv->hpr.jack = NULL;
>  	priv->mic.jack = NULL;
>  
> -	/* cancel any work waiting to be queued. */
> -	ret = cancel_delayed_work(&codec->delayed_work);
> -
>  	/* if there was any work waiting then we run it now and
>  	 * wait for its completion */
> -	if (ret) {
> -		schedule_delayed_work(&codec->delayed_work, 0);
> -		flush_scheduled_work();
> -	}
> +	flush_delayed_work_sync(&codec->delayed_work);

I vaguely remember Liam introduced this kind of code by some reason.

Liam, isn't it better for cancel_delayed_work_sync(), or should it be
like the above?


thanks,

Takashi

  parent reply	other threads:[~2010-12-12  8:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1292086307-19211-1-git-send-email-tj@kernel.org>
     [not found] ` <1292086307-19211-8-git-send-email-tj@kernel.org>
2010-12-11 21:33   ` [PATCH 07/30] ocfs2: " Joel Becker
     [not found] ` <1292086307-19211-10-git-send-email-tj@kernel.org>
2010-12-12  8:56   ` Takashi Iwai [this message]
2010-12-12  9:15     ` [PATCH 09/30] sound: " Tejun Heo
2010-12-12 12:38       ` Takashi Iwai
2010-12-12 12:40         ` Mark Brown
2010-12-12 16:02           ` Tejun Heo
2010-12-12 18:47             ` Mark Brown
2010-12-12 18:50               ` Tejun Heo
2010-12-12 19:00                 ` Mark Brown
2010-12-13 13:32                   ` Liam Girdwood
2010-12-13 16:36                     ` Olaya, Margarita
2010-12-13  8:34           ` Takashi Iwai
2010-12-13 13:29             ` Liam Girdwood
2010-12-13 16:12             ` Mark Brown
     [not found] ` <1292086307-19211-21-git-send-email-tj@kernel.org>
     [not found]   ` <20101211201931.00414518@endymion.delvare>
2010-12-12 13:37     ` [PATCH 20/30] macintosh/ams: " Michael Hanselmann
2010-12-13 10:16       ` Stelian Pop
2010-12-13 10:18         ` Jean Delvare
2010-12-13 10:40           ` [PATCH] Remove myself from MAINTAINERS as I no longer have the hardware to test Stelian Pop
2010-12-16  9:58             ` Jean Delvare
     [not found] ` <1292086307-19211-22-git-send-email-tj@kernel.org>
2010-12-13  8:44   ` [PATCH 21/30] pcmcia/ipwireless: don't use flush_scheduled_work() David Sterba
     [not found] ` <1292086307-19211-6-git-send-email-tj@kernel.org>
2010-12-13 11:21   ` [PATCH 05/30] net/dsa: " Lennert Buytenhek
     [not found] ` <1292086307-19211-28-git-send-email-tj@kernel.org>
2010-12-14 16:53   ` [PATCH 27/30] mtd: " Artem Bityutskiy
     [not found] ` <1292086307-19211-29-git-send-email-tj@kernel.org>
2010-12-22  0:07   ` [PATCH 28/30] battery: " Anton Vorontsov
2010-12-24 15:02 ` [PATCHSET] workqueue: remove flush_scheduled_work() usage Tejun Heo
     [not found] ` <1292086307-19211-2-git-send-email-tj@kernel.org>
2010-12-15 18:33   ` [PATCH 01/30] infiniband: update workqueue usage Roland Dreier
2010-12-16 16:50     ` Tejun Heo
2010-12-23 21:47       ` David Dillow
2011-01-17  5:21   ` Roland Dreier
2011-01-24 11:06     ` [PATCH] RDMA: update missed converion of flush_scheduled_work() Tejun Heo
2011-01-24 11:12       ` [PATCH RFC] RDMA: use alloc[_ordered]_workqueue() Tejun Heo
2011-01-29  0:40       ` [PATCH] RDMA: update missed converion of flush_scheduled_work() Roland Dreier
2011-01-31 10:36         ` Tejun Heo

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=s5hk4jfbc94.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=perex@perex.cz \
    --cc=tj@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome