Skip to content

gpiolib: export the consumer's PID to user-space

Bartosz Golaszewski linux-gpio lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2gpiolib: un-inline gpiod_request_user()drivers/gpio/gpiolib.c drivers/gpio/gpiolib.h+12 -112 replies
2/2gpiolib: cdev: export the consumer's PIDdrivers/gpio/gpiolib-cdev.c drivers/gpio/gpiolib.c drivers/gpio/gpiolib.h +1 more+27 -617 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAndy Shevchenko
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [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(-)
Signature · 1 line
2.34.1