From: William Breathitt Gray <william.gray@linaro.org>
To: Kamel Bouhara <kamel.bouhara@bootlin.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org
Subject: Re: Handling Signal1 in microchip-tcb-capture
Date: Tue, 18 Oct 2022 07:47:20 -0400 [thread overview]
Message-ID: <Y06SSCvh0tCtcKZ9@fedora> (raw)
In-Reply-To: <Y05dbRPh9jNj61y+@kb-xps>
[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]
On Tue, Oct 18, 2022 at 10:01:49AM +0200, Kamel Bouhara wrote:
> On Mon, Oct 17, 2022 at 05:57:59PM -0400, William Breathitt Gray wrote:
> > It might be nice to expose the channel 1 revolution value as Count1 at
> > some point in the future. However, channel 1 seems unrelated to the
> > current issue we're dicussing so we can avoid it for now.
>
> OK do you suggest to read both count values in the same mchp_tc_count_read() ?
Yes, you can differentiate between the requested Count by checking
count->id. So for id 0 return the channel 0 value, and for id 1 return
the channel 1 value.
> > By the way, I suspect there are race conditions present in
> > mcho_tc_count_function_write() that could be resolved by adding a lock
> > to the mchp_tc_data structure and acquiring it before accessing the
> > device state and registers. It's unrelated to the Signal1 issues so I
> > haven't looked any further into it, but it's something you might want to
> > investigate to make sure you don't get weird behavior from the driver.
> >
>
> You mean between function_write() and action_write() ?
Those are the callbacks that stood out immediately. For example, it's
possible that these functions are called concurrently, resulting in a
race where qdec_mode is initially evaluated as true but changes to false
before action_write() completes; or similarly, the regmap operations in
function_write() could be clobbered by if another call is happening at
the same time.
William Breathitt Gray
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: William Breathitt Gray <william.gray@linaro.org>
To: Kamel Bouhara <kamel.bouhara@bootlin.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org
Subject: Re: Handling Signal1 in microchip-tcb-capture
Date: Tue, 18 Oct 2022 07:47:20 -0400 [thread overview]
Message-ID: <Y06SSCvh0tCtcKZ9@fedora> (raw)
In-Reply-To: <Y05dbRPh9jNj61y+@kb-xps>
[-- Attachment #1.1: Type: text/plain, Size: 1517 bytes --]
On Tue, Oct 18, 2022 at 10:01:49AM +0200, Kamel Bouhara wrote:
> On Mon, Oct 17, 2022 at 05:57:59PM -0400, William Breathitt Gray wrote:
> > It might be nice to expose the channel 1 revolution value as Count1 at
> > some point in the future. However, channel 1 seems unrelated to the
> > current issue we're dicussing so we can avoid it for now.
>
> OK do you suggest to read both count values in the same mchp_tc_count_read() ?
Yes, you can differentiate between the requested Count by checking
count->id. So for id 0 return the channel 0 value, and for id 1 return
the channel 1 value.
> > By the way, I suspect there are race conditions present in
> > mcho_tc_count_function_write() that could be resolved by adding a lock
> > to the mchp_tc_data structure and acquiring it before accessing the
> > device state and registers. It's unrelated to the Signal1 issues so I
> > haven't looked any further into it, but it's something you might want to
> > investigate to make sure you don't get weird behavior from the driver.
> >
>
> You mean between function_write() and action_write() ?
Those are the callbacks that stood out immediately. For example, it's
possible that these functions are called concurrently, resulting in a
race where qdec_mode is initially evaluated as true but changes to false
before action_write() completes; or similarly, the regmap operations in
function_write() could be clobbered by if another call is happening at
the same time.
William Breathitt Gray
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-10-18 11:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-15 13:52 Handling Signal1 in microchip-tcb-capture William Breathitt Gray
2022-10-15 13:52 ` William Breathitt Gray
2022-10-17 9:59 ` Kamel Bouhara
2022-10-17 9:59 ` Kamel Bouhara
2022-10-17 12:53 ` William Breathitt Gray
2022-10-17 12:53 ` William Breathitt Gray
2022-10-17 17:06 ` Kamel Bouhara
2022-10-17 17:06 ` Kamel Bouhara
2022-10-17 21:57 ` William Breathitt Gray
2022-10-17 21:57 ` William Breathitt Gray
2022-10-18 8:01 ` Kamel Bouhara
2022-10-18 8:01 ` Kamel Bouhara
2022-10-18 11:47 ` William Breathitt Gray [this message]
2022-10-18 11:47 ` William Breathitt Gray
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=Y06SSCvh0tCtcKZ9@fedora \
--to=william.gray@linaro.org \
--cc=kamel.bouhara@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@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 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.