mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Felix Gu <ustc.gu@gmail.com>
Cc: "Francesco Dolcini" <francesco@dolcini.it>,
	"João Paulo Gonçalves" <jpaulo.silvagoncalves@gmail.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	"João Paulo Gonçalves" <joao.goncalves@toradex.com>,
	"Francesco Dolcini" <francesco.dolcini@toradex.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ti-ads1119: Reinit completion before wait_for_completion_timeout()
Date: Mon, 2 Mar 2026 19:54:26 +0000	[thread overview]
Message-ID: <20260302195426.11b4ce81@jic23-huawei> (raw)
In-Reply-To: <20260303-ti-ads1119-1-v1-1-e3fced089a44@gmail.com>

On Tue, 03 Mar 2026 00:48:45 +0800
Felix Gu <ustc.gu@gmail.com> wrote:

> The completion is not reinit before wait_for_completion_timeout(),
> so wait_for_completion_timeout() will return immediately after
> the first successful completion.
> 
> Fixes: a9306887eba4 ("iio: adc: ti-ads1119: Add driver")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
I agree there is a bug here but a question inline.
> ---
>  drivers/iio/adc/ti-ads1119.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c
> index c9cedc59cdcd..75dbb469fa27 100644
> --- a/drivers/iio/adc/ti-ads1119.c
> +++ b/drivers/iio/adc/ti-ads1119.c
> @@ -276,6 +276,9 @@ static int ads1119_single_conversion(struct ads1119_state *st,
>  	if (ret)
>  		goto pdown;
>  
> +	if (st->client->irq)
> +		reinit_completion(&st->completion);
> +
What's the reason for doing here rather than a few lines later.
That is before this
ret = i2c_smbus_write_byte(st->client, ADS1119_CMD_START_SYNC);
which the  naming suggests kicks of the actual channel capture?

Jonathan

>  	ret = ads1119_configure_channel(st, mux, gain, datarate);
>  	if (ret)
>  		goto pdown;
> 
> ---
> base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
> change-id: 20260303-ti-ads1119-1-cc68e3c01783
> 
> Best regards,


  reply	other threads:[~2026-03-02 19:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 16:48 Felix Gu
2026-03-02 19:54 ` Jonathan Cameron [this message]
2026-03-03 13:26   ` Felix Gu

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=20260302195426.11b4ce81@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=francesco@dolcini.it \
    --cc=joao.goncalves@toradex.com \
    --cc=jpaulo.silvagoncalves@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=ustc.gu@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®