All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Kent Gibson <warthog618@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jiri Kosina <jkosina@suse.cz>,
	Stefani Seibold <stefani@seibold.net>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [RESEND PATCH v5 6/7] gpiolib: add new ioctl() for monitoring changes in line info
Date: Thu, 23 Jan 2020 16:49:35 +0200	[thread overview]
Message-ID: <20200123144935.GV32742@smile.fi.intel.com> (raw)
In-Reply-To: <20200123140506.29275-7-brgl@bgdev.pl>

On Thu, Jan 23, 2020 at 03:05:05PM +0100, Bartosz Golaszewski 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.

...

> +	ret = kfifo_in_spinlocked(&priv->events, &chg,
> +				  1, &priv->wait.lock);

At least 1 can be moved to previous line.
(No need for new version, I hope you can fix this when applying)

> +	if (ret)
> +		wake_up_poll(&priv->wait, EPOLLIN);
> +	else
> +		pr_debug_ratelimited("lineinfo event FIFO is full - event dropped\n");
> +
> +	return NOTIFY_OK;
> +}

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-01-23 14:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 14:04 [RESEND PATCH v5 0/7] gpiolib: add an ioctl() for monitoring line status changes Bartosz Golaszewski
2020-01-23 14:05 ` [RESEND PATCH v5 1/7] kfifo: provide noirqsave variants of spinlocked in and out helpers Bartosz Golaszewski
2020-01-23 14:05 ` [RESEND PATCH v5 2/7] kfifo: provide kfifo_is_empty_spinlocked() Bartosz Golaszewski
2020-01-23 14:05 ` [RESEND PATCH v5 3/7] gpiolib: rework the locking mechanism for lineevent kfifo Bartosz Golaszewski
2020-01-23 14:05 ` [RESEND PATCH v5 4/7] gpiolib: emit a debug message when adding events to a full kfifo Bartosz Golaszewski
2020-01-23 14:05 ` [RESEND PATCH v5 5/7] gpiolib: provide a dedicated function for setting lineinfo Bartosz Golaszewski
2020-01-23 14:05 ` [RESEND PATCH v5 6/7] gpiolib: add new ioctl() for monitoring changes in line info Bartosz Golaszewski
2020-01-23 14:49   ` Andy Shevchenko [this message]
2020-01-23 14:05 ` [RESEND PATCH v5 7/7] tools: gpio: implement gpio-watch Bartosz Golaszewski
2020-01-23 14:50 ` [RESEND PATCH v5 0/7] gpiolib: add an ioctl() for monitoring line status changes Andy Shevchenko
2020-01-23 15:24   ` 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=20200123144935.GV32742@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=brgl@bgdev.pl \
    --cc=gregkh@linuxfoundation.org \
    --cc=jkosina@suse.cz \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefani@seibold.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.