From: Linus Walleij <linus.walleij@linaro.org>
To: William Breathitt Gray <vilhelm.gray@gmail.com>
Cc: David Lechner <david@lechnology.com>,
Greg KH <gregkh@linuxfoundation.org>,
Jonathan Cameron <jic23@kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-iio@vger.kernel.org,
Fabrice Gasnier <fabrice.gasnier@st.com>,
Benjamin Gaignard <benjamin.gaignard@st.com>,
Rob Herring <robh+dt@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [v7,03/10] docs: Add Generic Counter interface documentation
Date: Wed, 4 Jul 2018 19:23:26 +0200 [thread overview]
Message-ID: <CACRpkdbq1ued8gA-zcJYtK2jYJyMbuSkvinCvuoz_VGU=i+1nQ@mail.gmail.com> (raw)
In-Reply-To: <20180703141620.GB14958@sophia>
On Tue, Jul 3, 2018 at 4:16 PM William Breathitt Gray
<vilhelm.gray@gmail.com> wrote:
> On Mon, Jul 02, 2018 at 02:37:53PM -0500, David Lechner wrote:
> >On 06/21/2018 04:07 PM, William Breathitt Gray wrote:
> >> +Userspace Interface
> >> +===================
> >> +
> >> +Several sysfs attributes are generated by the Generic Counter interface,
> >> +and reside under the /sys/bus/counter/devices/counterX directory, where
> >> +counterX refers to the respective counter device. Please see
> >> +Documentation/ABI/testing/sys-bus-counter-generic-sysfs for detailed
> >> +information on each Generic Counter interface sysfs attribute.
> >> +
> >> +Through these sysfs attributes, programs and scripts may interact with
> >> +the Generic Counter paradigm Counts, Signals, and Synapses of respective
> >> +counter devices.
> >> +
> >
> >Have you considered a character device in addition to the sysfs interface?
> >
> >I basically have many of the same concerns that resulted in a char dev for
> >gpio[1].
> >
> >- With sysfs, you *can* technically poll for events, but then you have to
> > seek and read or re-open the file.
> >- File permissions are annoying if you want a non root user to be able to
> > use the device.
> >- A single program can't claim exclusive access to a device.
> >- There is no automatic cleanup if a userspace program accessing the device
> > crashes.
> >
> >[1]: https://www.elinux.org/images/7/74/Elce2017_new_GPIO_interface.pdf
>
> Those look like good technical reasons for implementing a character
> device for the Generic Counter interface. I chose to implement the sysfs
> interface because I was using the IIO code as a reference, but I
> personally don't have much opposition to a character device in addition.
IIO is also using a character device for outputting events and sensor
data. In IIO sysfs is only used for configuring what events and
data should come out of the character device.
> I'd like to get Jonathan's opinion on this as well if possible -- I
> vaguely recall us considering this option briefly last year when the
> Generic Counter interface was still in its beginnings. I've CC'd Linus
> Walleij as well for input as the GPIO maintainer.
The GPIO character device was based on the IIO character device.
We have one TODO item: to merge the timestamping format
between GPIO and IIO and use the same sysfs file for configuring
the time base.
Yours,
Linus Walleij
next prev parent reply other threads:[~2018-07-04 17:23 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-21 21:06 [PATCH v7 00/10] Introduce the Counter subsystem William Breathitt Gray
2018-06-21 21:07 ` [PATCH v7 01/10] counter: Introduce the Generic Counter interface William Breathitt Gray
2018-07-07 15:16 ` Greg KH
2018-07-09 17:40 ` William Breathitt Gray
2018-07-09 18:54 ` Greg KH
2018-07-09 18:56 ` William Breathitt Gray
2018-07-18 3:49 ` Andrew Morton
2018-07-21 16:26 ` William Breathitt Gray
2018-07-22 5:41 ` Andrew Morton
2018-06-21 21:07 ` [PATCH v7 02/10] counter: Documentation: Add Generic Counter sysfs documentation William Breathitt Gray
2018-07-02 19:11 ` [v7, " David Lechner
2018-07-03 14:04 ` William Breathitt Gray
2018-06-21 21:07 ` [PATCH v7 03/10] docs: Add Generic Counter interface documentation William Breathitt Gray
2018-06-22 16:51 ` Jonathan Cameron
2018-07-02 19:37 ` [v7,03/10] " David Lechner
2018-07-03 14:16 ` William Breathitt Gray
2018-07-04 17:23 ` Linus Walleij [this message]
2018-07-06 17:15 ` Jonathan Cameron
2018-07-06 18:25 ` David Lechner
2018-07-02 19:42 ` David Lechner
2018-07-03 14:21 ` William Breathitt Gray
2018-06-21 21:07 ` [PATCH v7 04/10] counter: 104-quad-8: Add Generic Counter interface support William Breathitt Gray
2018-06-22 16:57 ` Jonathan Cameron
2018-06-21 21:08 ` [PATCH v7 05/10] counter: 104-quad-8: Documentation: Add Generic Counter sysfs documentation William Breathitt Gray
2018-06-22 16:59 ` Jonathan Cameron
2018-06-21 21:08 ` [PATCH v7 06/10] counter: Add STM32 Timer quadrature encoder William Breathitt Gray
2018-06-22 17:03 ` Jonathan Cameron
2018-06-21 21:08 ` [PATCH v7 07/10] dt-bindings: counter: Document stm32 " William Breathitt Gray
2018-07-02 19:56 ` [v7,07/10] " David Lechner
2018-07-05 21:13 ` [PATCH v7 07/10] " Rob Herring
2018-06-21 21:08 ` [PATCH v7 08/10] counter: stm32-lptimer: add counter device William Breathitt Gray
2018-06-22 17:06 ` Jonathan Cameron
2018-06-21 21:08 ` [PATCH v7 09/10] dt-bindings: counter: Adjust dt-bindings for STM32 lptimer move William Breathitt Gray
2018-07-05 21:13 ` Rob Herring
2018-06-21 21:09 ` [PATCH v7 10/10] iio: counter: Add deprecation markings for IIO Counter attributes William Breathitt Gray
2018-06-22 17:10 ` [PATCH v7 00/10] Introduce the Counter subsystem Jonathan Cameron
2018-07-02 18:13 ` David Lechner
2018-07-03 2:48 ` William Breathitt Gray
2018-07-06 17:21 ` Jonathan Cameron
2018-07-06 18:22 ` David Lechner
2018-07-06 19:20 ` 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='CACRpkdbq1ued8gA-zcJYtK2jYJyMbuSkvinCvuoz_VGU=i+1nQ@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=benjamin.gaignard@st.com \
--cc=david@lechnology.com \
--cc=devicetree@vger.kernel.org \
--cc=fabrice.gasnier@st.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pmeerw@pmeerw.net \
--cc=robh+dt@kernel.org \
--cc=vilhelm.gray@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;
as well as URLs for NNTP newsgroup(s).