[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b7c690eb-274e-3377-cf8a-2f9ab836677e@lechnology.com>
Date: Mon, 2 Jul 2018 14:37:53 -0500
From: David Lechner <david@...hnology.com>
To: William Breathitt Gray <vilhelm.gray@...il.com>,
gregkh@...uxfoundation.org
Cc: jic23@...nel.org, linux-arm-kernel@...ts.infradead.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org, fabrice.gasnier@...com,
benjamin.gaignard@...com, robh+dt@...nel.org, knaack.h@....de,
lars@...afoo.de, pmeerw@...erw.net, mark.rutland@....com
Subject: Re: [v7,03/10] docs: Add Generic Counter interface documentation
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
Powered by blists - more mailing lists