[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MfkbJ=zTvgpaxFC7L7APEhfC7J_PcncGaQ_AQUA9uw2Fw@mail.gmail.com>
Date: Wed, 12 Feb 2020 12:00:42 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Linus Walleij <linus.walleij@...aro.org>,
Arnd Bergmann <arnd@...db.de>
Cc: Kent Gibson <warthog618@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: Re: [RESEND PATCH v6 6/7] gpiolib: add new ioctl() for monitoring
changes in line info
śr., 12 lut 2020 o 11:47 Linus Walleij <linus.walleij@...aro.org> napisał(a):
>
> On Tue, Feb 11, 2020 at 10:19 AM Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> > From: Bartosz Golaszewski <bgolaszewski@...libre.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.
> >
> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
>
> Looks good to me. This got really slim and clean after
> the reviews, and I am of course also impressed by the kfifo
> improvement this brings.
>
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
>
> A question:
>
> Bartosz, since you know about possible impacts on userspace,
> since this code use the preferred ktime_get_ns() rather than
> ktime_get_ns_real(), what happens if we just patch the other
> event timestamp to use ktime_get_ns() instead, so we use the
> same everywhere?
>
> If it's fine I'd like to just toss in a patch for that as well.
>
Arnd pointed out it would be an incompatible ABI change[1].
However - I asked Khouloud who's working on v2 of the line event
interface to use ktime_get_ns().
Cheers
Bart
[1] https://marc.info/?l=linux-gpio&m=151661955709074&w=2
Powered by blists - more mailing lists