linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] gpiolib: export the consumer's PID to user-space
@ 2022-09-09 12:13 Bartosz Golaszewski
  2022-09-09 12:13 ` [PATCH 1/2] gpiolib: un-inline gpiod_request_user() Bartosz Golaszewski
  2022-09-09 12:13 ` [PATCH 2/2] gpiolib: cdev: export the consumer's PID Bartosz Golaszewski
  0 siblings, 2 replies; 22+ messages in thread
From: Bartosz Golaszewski @ 2022-09-09 12:13 UTC (permalink / raw)
  To: Kent Gibson, Linus Walleij, Andy Shevchenko, Viresh Kumar
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-09-14  1:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09 12:13 [PATCH 0/2] gpiolib: export the consumer's PID to user-space Bartosz Golaszewski
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

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).