Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Lars-Peter Clausen <lars@metafoo.de>, linux-iio@vger.kernel.org
Subject: Re: [PATCH v2] iio:light:tsl2563: Replace flush_scheduled_work() with cancel_delayed_work_sync().
Date: Sat, 18 Jun 2022 14:52:29 +0100	[thread overview]
Message-ID: <20220618145229.5c8fd452@jic23-huawei> (raw)
In-Reply-To: <3381176e-2f86-24ba-a8ba-c4ce8f416086@I-love.SAKURA.ne.jp>

On Sun, 12 Jun 2022 23:52:59 +0900
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:

> Commit 9e61d901155bcd4e ("iio: light: tsl2563: Remove
> flush_scheduled_work") replaced cancel_delayed_work() +
> flush_scheduled_work() with cancel_delayed_work_sync() for only
> tsl2563_probe() side.
> 
> Do the same thing for tsl2563_remove() side, which was added by
> commit 388be4883952872b ("staging:iio: tsl2563 abi fixes and interrupt
> handling").
> 
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> ---
> Changes in v2:
>   Use cancel_delayed_work_sync() instead of introducing a dedicated WQ.
Nice.  This does the job without the complexity or overhead of a dedicated
work queue.  

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to see if we missed anything.

Thanks,

Jonathqan

> 
> Please see commit c4f135d643823a86 ("workqueue: Wrap flush_workqueue()
> using a macro") for background.
> 
>  drivers/iio/light/tsl2563.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
> index 0a278eea36ca..4d89ac3a5bbc 100644
> --- a/drivers/iio/light/tsl2563.c
> +++ b/drivers/iio/light/tsl2563.c
> @@ -803,12 +803,11 @@ static int tsl2563_remove(struct i2c_client *client)
>  
>  	iio_device_unregister(indio_dev);
>  	if (!chip->int_enabled)
> -		cancel_delayed_work(&chip->poweroff_work);
> +		cancel_delayed_work_sync(&chip->poweroff_work);
>  	/* Ensure that interrupts are disabled - then flush any bottom halves */
>  	chip->intr &= ~0x30;
>  	i2c_smbus_write_byte_data(chip->client, TSL2563_CMD | TSL2563_REG_INT,
>  				  chip->intr);
> -	flush_scheduled_work();
>  	tsl2563_set_power(chip, 0);
>  
>  	return 0;


      reply	other threads:[~2022-06-18 13:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10  6:06 [PATCH] iio:light:tsl2563: avoid flush_scheduled_work() usage Tetsuo Handa
2022-06-12 14:52 ` [PATCH v2] iio:light:tsl2563: Replace flush_scheduled_work() with cancel_delayed_work_sync() Tetsuo Handa
2022-06-18 13:52   ` Jonathan Cameron [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=20220618145229.5c8fd452@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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