linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] gpio: cdev: bail out of poll() if the device goes down
@ 2023-08-17 18:49 Bartosz Golaszewski
  2023-08-17 18:49 ` [PATCH v2 1/6] gpiolib: rename the gpio_device notifier Bartosz Golaszewski
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Bartosz Golaszewski @ 2023-08-17 18:49 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko, Kent Gibson
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

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

-- 
2.39.2


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

end of thread, other threads:[~2023-08-21 13:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 18:49 [PATCH v2 0/6] gpio: cdev: bail out of poll() if the device goes down Bartosz Golaszewski
2023-08-17 18:49 ` [PATCH v2 1/6] gpiolib: rename the gpio_device notifier Bartosz Golaszewski
2023-08-17 18:49 ` [PATCH v2 2/6] gpio: cdev: open-code to_gpio_chardev_data() Bartosz Golaszewski
2023-08-18 10:28   ` Andy Shevchenko
2023-08-17 18:49 ` [PATCH v2 3/6] gpiolib: add a second blocking notifier to struct gpio_device Bartosz Golaszewski
2023-08-17 18:49 ` [PATCH v2 4/6] gpio: cdev: wake up chardev poll() on device unbind Bartosz Golaszewski
2023-08-18 10:30   ` Andy Shevchenko
2023-08-21 12:43     ` Bartosz Golaszewski
2023-08-21 13:03       ` Bartosz Golaszewski
2023-08-21 13:34     ` Bartosz Golaszewski
2023-08-17 18:49 ` [PATCH v2 5/6] gpio: cdev: wake up linereq " Bartosz Golaszewski
2023-08-17 18:49 ` [PATCH v2 6/6] gpio: cdev: wake up lineevent " Bartosz Golaszewski
2023-08-18  0:16 ` [PATCH v2 0/6] gpio: cdev: bail out of poll() if the device goes down Kent Gibson
2023-08-18  7:20 ` Linus Walleij
2023-08-18 10:34 ` Andy Shevchenko
2023-08-18 12:06   ` Bartosz Golaszewski
2023-08-18 13:29     ` Andy Shevchenko
2023-08-18 13:36       ` Bartosz Golaszewski
2023-08-18 19:16         ` Bartosz Golaszewski

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