From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH 0/5] gpio: cdev: bail out of poll() if the device goes down
Date: Thu, 17 Aug 2023 12:41:18 +0800 [thread overview]
Message-ID: <ZN2k7gemanIpbyFh@sol> (raw)
In-Reply-To: <CACRpkdaTUi0r+nY12J8sLxmvfG2xRd+OMngcMiQkr5cqerevtA@mail.gmail.com>
On Wed, Aug 16, 2023 at 11:41:06PM +0200, Linus Walleij wrote:
> On Wed, Aug 16, 2023 at 2:20 PM Bartosz Golaszewski <brgl@bgdev.pl> 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.
> >
> > Bartosz Golaszewski (5):
> > gpio: cdev: ignore notifications other than line status changes
> > gpio: cdev: rename the notifier block and notify callback
> > 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
>
> I see why this is needed and while the whole notification chain
> is a bit clunky I really cannot think about anything better so:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
The issue I have is with the repurposing/reuse of the existing notifier
block that sends line changed events to the chardev.
Correct me if I'm wrong, but now all line requests will receive those
events as well.
They have no business receiving those events, and it scales badly.
My preference would be for a separate nb for the chip removal to keep
those two classes of events distinct.
Cheers,
Kent.
next prev parent reply other threads:[~2023-08-17 5:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 12:20 [PATCH 0/5] gpio: cdev: bail out of poll() if the device goes down Bartosz Golaszewski
2023-08-16 12:20 ` [PATCH 1/5] gpio: cdev: ignore notifications other than line status changes Bartosz Golaszewski
2023-08-16 12:20 ` [PATCH 2/5] gpio: cdev: rename the notifier block and notify callback Bartosz Golaszewski
2023-08-16 12:20 ` [PATCH 3/5] gpio: cdev: wake up chardev poll() on device unbind Bartosz Golaszewski
2023-08-16 12:20 ` [PATCH 4/5] gpio: cdev: wake up linereq " Bartosz Golaszewski
2023-08-16 12:20 ` [PATCH 5/5] gpio: cdev: wake up lineevent " Bartosz Golaszewski
2023-08-17 9:12 ` kernel test robot
2023-08-16 21:41 ` [PATCH 0/5] gpio: cdev: bail out of poll() if the device goes down Linus Walleij
2023-08-17 4:41 ` Kent Gibson [this message]
2023-08-17 7:00 ` Linus Walleij
2023-08-17 7:27 ` Bartosz Golaszewski
2023-08-17 7:37 ` Kent Gibson
2023-08-17 7:41 ` 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=ZN2k7gemanIpbyFh@sol \
--to=warthog618@gmail.com \
--cc=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 \
/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;
as well as URLs for NNTP newsgroup(s).