linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: William Breathitt Gray <wbg@kernel.org>
To: "Bence Csókás" <csokas.bence@prolan.hu>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org,
	Kamel Bouhara <kamel.bouhara@bootlin.com>
Subject: Re: [PATCH v6 1/3] include: uapi: counter: Add microchip-tcb-capture.h
Date: Tue, 4 Mar 2025 18:51:18 +0900	[thread overview]
Message-ID: <Z8bNFjh85p2jqK9C@ishi> (raw)
In-Reply-To: <20250227144023.64530-2-csokas.bence@prolan.hu>

[-- Attachment #1: Type: text/plain, Size: 2247 bytes --]

On Thu, Feb 27, 2025 at 03:40:18PM +0100, Bence Csókás wrote:
> Add UAPI header for the microchip-tcb-capture.c driver.
> This header will hold the various event channels, component numbers etc.
> used by this driver.
> 
> Signed-off-by: Bence Csókás <csokas.bence@prolan.hu>

Oops, I almost missed this one! Make sure I'm included in the To field
for the next revision. ;-)

By the way, b4 is a nifty tool that can save you some work and help you
prep patch series for submission.[^1]

> +/*
> + * The driver defines the following components:
> + *
> + * Count 0
> + * \__  Synapse 0 -- Signal 0 (Channel A, i.e. TIOA)
> + * \__  Synapse 1 -- Signal 1 (Channel B, i.e. TIOB)
> + */
> +
> +enum counter_mchp_signals {
> +	COUNTER_MCHP_SIG_TIOA,
> +	COUNTER_MCHP_SIG_TIOB,
> +};

Are these meant to be used to identify the Signals in the
microchip-tcb-capture.c file. You should set the the counter_signal id
members to these enum constants then. However, this enum doesn't need to
be exposed to userspace in that case.

Or is the purpose of this to match the parent ID of the Signal when
you create Counter watches? That won't work safely the way you intend
because the Counter subsystem creates the userspace parent IDs
independent of the kernelspace counter_signal struct id member.

Right now the Counter subsystem just happens to create these parent IDs
sequentially from 0 because it was a simple way to implement it at the
time we introduced the feature. However, there is nothing that ensures
this will stay that way in the future, and in fact the design intention
was exactly to allow the possibility of a future change to this area of
code.

In other words, there's no gurantee the parent ID in userspace will
remain the same even between driver reloads. The intended way for
userspace to behave is to first identify the desired Signals at startup
based on their "name" sysfs attribute and then set Counter watches and
such accordingly thereafter as desired.

If that is the only purpose of enum counter_mchp_signals, then we can
omit this patch from the series and you won't need to send it in the
next revision.

William Breathitt Gray

[^1] https://b4.docs.kernel.org/en/latest/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-03-04  9:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27 14:40 [PATCH v6 0/3] microchip-tcb-capture: Add Capture, Compare, Overflow etc. events Bence Csókás
2025-02-27 14:40 ` [PATCH v6 1/3] include: uapi: counter: Add microchip-tcb-capture.h Bence Csókás
2025-03-04  9:51   ` William Breathitt Gray [this message]
2025-03-04 11:14     ` Csókás Bence
2025-03-04 11:54       ` William Breathitt Gray
2025-02-27 14:40 ` [PATCH v6 2/3] counter: microchip-tcb-capture: Add IRQ handling Bence Csókás
2025-03-04  7:02   ` William Breathitt Gray
2025-03-04  9:57     ` Csókás Bence
2025-03-04 10:18       ` William Breathitt Gray
2025-02-27 14:40 ` [PATCH v6 3/3] counter: microchip-tcb-capture: Add capture extensions for registers RA/RB Bence Csókás
2025-03-04  7:47   ` William Breathitt Gray
2025-03-04 10:03     ` Csókás Bence
2025-03-04 10:21       ` 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=Z8bNFjh85p2jqK9C@ishi \
    --to=wbg@kernel.org \
    --cc=csokas.bence@prolan.hu \
    --cc=kamel.bouhara@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --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;
as well as URLs for NNTP newsgroup(s).