[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220909121329.42004-1-brgl@bgdev.pl>
Date: Fri, 9 Sep 2022 14:13:27 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Kent Gibson <warthog618@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Viresh Kumar <viresh.kumar@...aro.org>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Bartosz Golaszewski <brgl@...ev.pl>
Subject: [PATCH 0/2] gpiolib: export the consumer's PID to user-space
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
Powered by blists - more mailing lists