All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] gpiolib: cdev: clear debounce period if line set to output" failed to apply to 5.10-stable tree
@ 2021-02-08 10:11 gregkh
  2021-02-08 23:33 ` [BACKPORT 5.10 PATCH] gpiolib: cdev: clear debounce period if line set to output Kent Gibson
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2021-02-08 10:11 UTC (permalink / raw)
  To: warthog618, bgolaszewski, linus.walleij; +Cc: stable


The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 03a58ea5905fdbd93ff9e52e670d802600ba38cd Mon Sep 17 00:00:00 2001
From: Kent Gibson <warthog618@gmail.com>
Date: Thu, 21 Jan 2021 22:10:38 +0800
Subject: [PATCH] gpiolib: cdev: clear debounce period if line set to output

When set_config changes a line from input to output debounce is
implicitly disabled, as debounce makes no sense for outputs, but the
debounce period is not being cleared and is still reported in the
line info.

So clear the debounce period when the debouncer is stopped in
edge_detector_stop().

Fixes: 65cff7046406 ("gpiolib: cdev: support setting debounce")
Cc: stable@vger.kernel.org
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
index 1a7b51163528..1631727bf0da 100644
--- a/drivers/gpio/gpiolib-cdev.c
+++ b/drivers/gpio/gpiolib-cdev.c
@@ -776,6 +776,8 @@ static void edge_detector_stop(struct line *line)
 	cancel_delayed_work_sync(&line->work);
 	WRITE_ONCE(line->sw_debounced, 0);
 	WRITE_ONCE(line->eflags, 0);
+	if (line->desc)
+		WRITE_ONCE(line->desc->debounce_period_us, 0);
 	/* do not change line->level - see comment in debounced_value() */
 }
 


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

* [BACKPORT 5.10 PATCH] gpiolib: cdev: clear debounce period if line set to output
  2021-02-08 10:11 FAILED: patch "[PATCH] gpiolib: cdev: clear debounce period if line set to output" failed to apply to 5.10-stable tree gregkh
@ 2021-02-08 23:33 ` Kent Gibson
  2021-02-10 14:10   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Kent Gibson @ 2021-02-08 23:33 UTC (permalink / raw)
  To: stable, gregkh; +Cc: Kent Gibson, Linus Walleij, Bartosz Golaszewski

commit 03a58ea5905fdbd93ff9e52e670d802600ba38cd upstream.

When set_config changes a line from input to output debounce is
implicitly disabled, as debounce makes no sense for outputs, but the
debounce period is not being cleared and is still reported in the
line info.

So clear the debounce period when the debouncer is stopped in
edge_detector_stop().

Fixes: 65cff7046406 ("gpiolib: cdev: support setting debounce")
Cc: stable@vger.kernel.org
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/gpio/gpiolib-cdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
index 12b679ca552c..3551aaf5a361 100644
--- a/drivers/gpio/gpiolib-cdev.c
+++ b/drivers/gpio/gpiolib-cdev.c
@@ -756,6 +756,8 @@ static void edge_detector_stop(struct line *line)
 	cancel_delayed_work_sync(&line->work);
 	WRITE_ONCE(line->sw_debounced, 0);
 	line->eflags = 0;
+	if (line->desc)
+		WRITE_ONCE(line->desc->debounce_period_us, 0);
 	/* do not change line->level - see comment in debounced_value() */
 }
 
-- 
2.30.0


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

* Re: [BACKPORT 5.10 PATCH] gpiolib: cdev: clear debounce period if line set to output
  2021-02-08 23:33 ` [BACKPORT 5.10 PATCH] gpiolib: cdev: clear debounce period if line set to output Kent Gibson
@ 2021-02-10 14:10   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2021-02-10 14:10 UTC (permalink / raw)
  To: Kent Gibson; +Cc: stable, Linus Walleij, Bartosz Golaszewski

On Tue, Feb 09, 2021 at 07:33:25AM +0800, Kent Gibson wrote:
> commit 03a58ea5905fdbd93ff9e52e670d802600ba38cd upstream.
> 
> When set_config changes a line from input to output debounce is
> implicitly disabled, as debounce makes no sense for outputs, but the
> debounce period is not being cleared and is still reported in the
> line info.
> 
> So clear the debounce period when the debouncer is stopped in
> edge_detector_stop().
> 
> Fixes: 65cff7046406 ("gpiolib: cdev: support setting debounce")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kent Gibson <warthog618@gmail.com>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  drivers/gpio/gpiolib-cdev.c | 2 ++
>  1 file changed, 2 insertions(+)

Now applied, thanks.

greg k-h

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

end of thread, other threads:[~2021-02-10 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 10:11 FAILED: patch "[PATCH] gpiolib: cdev: clear debounce period if line set to output" failed to apply to 5.10-stable tree gregkh
2021-02-08 23:33 ` [BACKPORT 5.10 PATCH] gpiolib: cdev: clear debounce period if line set to output Kent Gibson
2021-02-10 14:10   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.