From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Kent Gibson <warthog618@gmail.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH v2 0/6] gpio: cdev: bail out of poll() if the device goes down
Date: Fri, 18 Aug 2023 16:29:46 +0300 [thread overview]
Message-ID: <ZN9ySmxxdoLODcc9@smile.fi.intel.com> (raw)
In-Reply-To: <CAMRc=MfZ=GgcqKkDXkUgWC-bdCJECs0HfjRe9Ffy-Metwz6fFQ@mail.gmail.com>
On Fri, Aug 18, 2023 at 02:06:21PM +0200, Bartosz Golaszewski wrote:
> On Fri, Aug 18, 2023 at 12:34 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > On Thu, Aug 17, 2023 at 08:49:52PM +0200, Bartosz Golaszewski wrote:
> > > 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.
> >
> > Why can't you use the global device unbind notifications and filter out
> > what you are interested in?
>
> There's no truly global device unbind notification - only per-bus.
> GPIO devices can reside on any bus, there are no limitations and so
> we'd have to subscribe to all of them.
We have, but it requires a bit of code patching.
Look at device_platform_notify()/device_platform_notify_remove().
I noticed, btw, that platform_notify() and Co is a dead code :-)
Maybe it can be converted to a list and a manager of that list,
so specific cases can utilize it.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-08-18 13:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-08-18 13:36 ` Bartosz Golaszewski
2023-08-18 19:16 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZN9ySmxxdoLODcc9@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=warthog618@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox