From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Kent Gibson <warthog618@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [PATCH 0/2] gpiolib: export the consumer's PID to user-space
Date: Fri, 9 Sep 2022 14:13:27 +0200 [thread overview]
Message-ID: <20220909121329.42004-1-brgl@bgdev.pl> (raw)
I've been asked several times independently over the course of last months
for a way to figure out the PID of the user-space process that's holding
a specific GPIO line. This does sound like a valid use-case as the user may
create a background process that requests some lines and then want to kill
it to release those lines.
These patches propose to extend the gpio_v2_line_info struct with the
consumer's PID which is set to the process ID for user-space consumers and
0 for kernel-space ones.
Bartosz Golaszewski (2):
gpiolib: un-inline gpiod_request_user()
gpiolib: cdev: export the consumer's PID
drivers/gpio/gpiolib-cdev.c | 2 ++
drivers/gpio/gpiolib.c | 33 +++++++++++++++++++++++++++++----
drivers/gpio/gpiolib.h | 14 +++-----------
include/uapi/linux/gpio.h | 5 ++++-
4 files changed, 38 insertions(+), 16 deletions(-)
--
2.34.1
next reply other threads:[~2022-09-09 12:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-09 12:13 Bartosz Golaszewski [this message]
2022-09-09 12:13 ` [PATCH 1/2] gpiolib: un-inline gpiod_request_user() Bartosz Golaszewski
2022-09-09 13:45 ` Andy Shevchenko
2022-09-10 14:51 ` Kent Gibson
2022-09-09 12:13 ` [PATCH 2/2] gpiolib: cdev: export the consumer's PID Bartosz Golaszewski
2022-09-09 13:45 ` Andy Shevchenko
2022-09-09 13:48 ` Andy Shevchenko
2022-09-09 19:18 ` Bartosz Golaszewski
2022-09-10 14:52 ` Kent Gibson
2022-09-12 8:52 ` Bartosz Golaszewski
2022-09-12 9:53 ` Kent Gibson
2022-09-12 9:56 ` Bartosz Golaszewski
2022-09-13 2:12 ` Kent Gibson
2022-09-13 8:54 ` Bartosz Golaszewski
2022-09-13 14:28 ` Kent Gibson
2022-09-13 14:35 ` Bartosz Golaszewski
2022-09-13 14:55 ` Kent Gibson
2022-09-13 15:58 ` Bartosz Golaszewski
2022-09-13 16:17 ` Kent Gibson
2022-09-13 17:07 ` Andy Shevchenko
2022-09-13 19:35 ` Bartosz Golaszewski
2022-09-14 1:00 ` Kent Gibson
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=20220909121329.42004-1-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viresh.kumar@linaro.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 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.