linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Kent Gibson <warthog618@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH v3 12/13] gpiolib: add new ioctl() for monitoring changes in line info
Date: Tue, 24 Dec 2019 13:08:41 +0100	[thread overview]
Message-ID: <CAMRc=MdCQkooyMLH8E2uX8+gT7h8VsXnvv0oXvCstb=vjHJ8WA@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VeMEngXiFmvTrsW7UZMz0ppR-W-J4D1xU+qKGfLXkG3kg@mail.gmail.com>

czw., 19 gru 2019 o 19:17 Andy Shevchenko <andy.shevchenko@gmail.com>
napisał(a):
>
> On Thu, Dec 19, 2019 at 7:17 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > Currently there is no way for user-space to be informed about changes
> > in status of GPIO lines e.g. when someone else requests the line or its
> > config changes. We can only periodically re-read the line-info. This
> > is fine for simple one-off user-space tools, but any daemon that provides
> > a centralized access to GPIO chips would benefit hugely from an event
> > driven line info synchronization.
> >
> > This patch adds a new ioctl() that allows user-space processes to reuse
> > the file descriptor associated with the character device for watching
> > any changes in line properties. Every such event contains the updated
> > line information.
> >
> > Currently the events are generated on three types of status changes: when
> > a line is requested, when it's released and when its config is changed.
> > The first two are self-explanatory. For the third one: this will only
> > happen when another user-space process calls the new SET_CONFIG ioctl()
> > as any changes that can happen from within the kernel (i.e.
> > set_transitory() or set_debounce()) are of no interest to user-space.
>
> > -       } else if (cmd == GPIO_GET_LINEINFO_IOCTL) {
> > +       } else if (cmd == GPIO_GET_LINEINFO_IOCTL ||
> > +                  cmd == GPIO_GET_LINEINFO_WATCH_IOCTL) {
>
> Wouldn't be better for maintenance to have them separated from the day 1?
>

I think this would lead to a lot of code duplication. I left it as it is is v4.

Bart

  parent reply	other threads:[~2019-12-24 12:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 17:15 [PATCH v3 00/13] gpiolib: add an ioctl() for monitoring line status changes Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 01/13] gpiolib: use 'unsigned int' instead of 'unsigned' in gpio_set_config() Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 02/13] gpiolib: have a single place of calling set_config() Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 03/13] gpiolib: convert the type of hwnum to unsigned int in gpiochip_get_desc() Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 04/13] gpiolib: use gpiochip_get_desc() in linehandle_create() Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 05/13] gpiolib: use gpiochip_get_desc() in lineevent_create() Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 06/13] gpiolib: use gpiochip_get_desc() in gpio_ioctl() Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 07/13] kfifo: provide noirqsave variants of spinlocked in and out helpers Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 08/13] kfifo: provide kfifo_is_empty_spinlocked() Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 09/13] gpiolib: rework the locking mechanism for lineevent kfifo Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 10/13] gpiolib: emit a debug message when adding events to a full kfifo Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 11/13] gpiolib: provide a dedicated function for setting lineinfo Bartosz Golaszewski
2019-12-19 17:15 ` [PATCH v3 12/13] gpiolib: add new ioctl() for monitoring changes in line info Bartosz Golaszewski
2019-12-19 17:24   ` Greg Kroah-Hartman
2019-12-20  8:45     ` Bartosz Golaszewski
2019-12-19 18:17   ` Andy Shevchenko
2019-12-20 11:25     ` Bartosz Golaszewski
2019-12-20 12:15       ` Andy Shevchenko
2019-12-20 17:29         ` Bartosz Golaszewski
2019-12-24 12:09           ` Bartosz Golaszewski
2019-12-24 12:08     ` Bartosz Golaszewski [this message]
2019-12-19 17:15 ` [PATCH v3 13/13] tools: gpio: implement gpio-watch Bartosz Golaszewski

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='CAMRc=MdCQkooyMLH8E2uX8+gT7h8VsXnvv0oXvCstb=vjHJ8WA@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=warthog618@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).