From: Jonathan Cameron <jic23@kernel.org>
To: Abhash jha <abhashkumarjha123@gmail.com>
Cc: linux-iio@vger.kernel.org, lars@metafoo.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] iio: light: vl6180: Added Interrupt support for single shot access
Date: Sat, 5 Oct 2024 19:08:51 +0100 [thread overview]
Message-ID: <20241005190851.66145d1b@jic23-huawei> (raw)
In-Reply-To: <CAG=0RqJntw8njb-tzbDU5oALCNd2EEb=QFP=Uqzcxsehy4mzbg@mail.gmail.com>
On Sat, 5 Oct 2024 23:05:25 +0530
Abhash jha <abhashkumarjha123@gmail.com> wrote:
> > > + if (client->irq) {
> > > + reinit_completion(&data->completion);
> >
> > That's late so there is a race condition. You might be delayed just before this
> > and finish the measurement before the reint_completion() in which case you'll
> > clear the complete() that happens in the interrupt handler before
> > then waiting on it.
> Yes this makes sense.
>
> > This reinit needs to be before whatever can potentially trigger
> > that interrupt.
> Can you explain this part, because where can i reinit it, The measurement
> starts when we write the START_STOP bit to SYSRANGE_START. So should
> it be before that.
Immediately above that write looks right to me. So before writing START_STOP.
That way the completion will be ready for a complete whenever
one turns up.
Jonathan
> I'm kind of confused with this.
>
> Thank you,
> Abhash
next prev parent reply other threads:[~2024-10-05 18:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 15:01 [PATCH 0/3] Interrupt and Continuous mode support for VL6180 Abhash Jha
2024-10-04 15:01 ` [PATCH 1/3] iio: light: vl6180: Add configurable inter-measurement period support Abhash Jha
2024-10-05 12:25 ` kernel test robot
2024-10-05 16:41 ` Jonathan Cameron
2024-10-05 16:56 ` Abhash jha
2024-10-05 17:03 ` Jonathan Cameron
2024-10-04 15:01 ` [PATCH 2/3] iio: light: vl6180: Added Interrupt support for single shot access Abhash Jha
2024-10-05 16:47 ` Jonathan Cameron
2024-10-05 17:35 ` Abhash jha
2024-10-05 18:08 ` Jonathan Cameron [this message]
2024-10-04 15:01 ` [PATCH 3/3] iio: light: vl6180: Add support for Continuous Mode Abhash Jha
2024-10-05 16:59 ` Jonathan Cameron
2024-10-05 17:12 ` Abhash jha
2024-10-05 18:15 ` Jonathan Cameron
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=20241005190851.66145d1b@jic23-huawei \
--to=jic23@kernel.org \
--cc=abhashkumarjha123@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.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