Skip to content

gpio: cdev: bail out of poll() if the device goes down

Bartosz Golaszewski linux-gpio lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 12 repliesIn review
  2. v15 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- not much is left from v1, this time we don't repurpose the existing gpio_device notifier but add a new one so that cdev structures don't get unwanted events

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6gpiolib: rename the gpio_device notifierdrivers/gpio/gpiolib-cdev.c drivers/gpio/gpiolib.c drivers/gpio/gpiolib.h+14 -140 replies
2/6gpio: cdev: open-code to_gpio_chardev_data()drivers/gpio/gpiolib-cdev.c+3 -71 reply
3/6gpiolib: add a second blocking notifier to struct gpio_devicedrivers/gpio/gpiolib-cdev.c drivers/gpio/gpiolib.c drivers/gpio/gpiolib.h+5 -00 replies
4/6gpio: cdev: wake up chardev poll() on device unbinddrivers/gpio/gpiolib-cdev.c+27 -24 replies
5/6gpio: cdev: wake up linereq poll() on device unbinddrivers/gpio/gpiolib-cdev.c+23 -00 replies
6/6gpio: cdev: wake up lineevent poll() on device unbinddrivers/gpio/gpiolib-cdev.c+22 -00 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKent GibsonLinus Walleij
SeriesR-b R-b
1/6
2/6
3/6
4/6
5/6
6/6

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

Read the v2 thread

Cover letter [PATCH v2 0/6] gpio: cdev: bail out of poll() if the device goes down

From: Bartosz Golaszewski <[email protected]>

Wake up all three wake queues (the one associated with the character device file, the one for V1 line events and the V2 line request one) when the underlying GPIO device is unregistered. This way we won't get stuck in poll() after the chip is gone as user-space will be forced to go back into a new system call and will see that gdev->chip is NULL.

v1 -> v2:
- not much is left from v1, this time we don't repurpose the existing gpio_device notifier but add a new one so that cdev structures don't get unwanted events

Bartosz Golaszewski (6):
gpiolib: rename the gpio_device notifier
gpio: cdev: open-code to_gpio_chardev_data()
gpiolib: add a second blocking notifier to struct gpio_device
gpio: cdev: wake up chardev poll() on device unbind
gpio: cdev: wake up linereq poll() on device unbind
gpio: cdev: wake up lineevent poll() on device unbind

 drivers/gpio/gpiolib-cdev.c | 101 ++++++++++++++++++++++++++++++------
 drivers/gpio/gpiolib.c      |   7 +--
 drivers/gpio/gpiolib.h      |   9 ++--
 3 files changed, 94 insertions(+), 23 deletions(-)
Signature · 1 line
2.39.2