[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241014021140.GC20620@rigel>
Date: Mon, 14 Oct 2024 10:11:40 +0800
From: Kent Gibson <warthog618@...il.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Linus Walleij <linus.walleij@...aro.org>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v2 5/6] gpiolib: switch the line state notifier to atomic
On Thu, Oct 10, 2024 at 11:10:26AM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> With everything else ready, we can now switch to using the atomic
> notifier for line state events which will allow us to notify user-space
> about direction changes from atomic context.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> ---
> drivers/gpio/gpiolib-cdev.c | 22 ++++++++++++++++------
> drivers/gpio/gpiolib.c | 6 +++---
> drivers/gpio/gpiolib.h | 2 +-
> 3 files changed, 20 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
> index 2677134b52cd..7eae0b17a1d6 100644
> --- a/drivers/gpio/gpiolib-cdev.c
> +++ b/drivers/gpio/gpiolib-cdev.c
> @@ -2673,6 +2673,16 @@ static int lineinfo_changed_notify(struct notifier_block *nb,
> if (!test_bit(gpio_chip_hwgpio(desc), cdev->watched_lines))
> return NOTIFY_DONE;
>
> + /*
> + * This is called from atomic context (with a spinlock taken by the
> + * atomic notifier chain). Any sleeping calls must be done outside of
> + * this function in process context of the dedicated workqueue.
> + *
> + * Let's gather as much info as possible from the descriptor and
> + * postpone just the call to pinctrl_gpio_can_use_line() until the work
> + * is executed.
> + */
> +
Should be in patch 4? You aren't otherwise changing that function here.
Cheers,
Kent.
Powered by blists - more mailing lists