[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YoR6N2ACf3TZr1P5@google.com>
Date: Tue, 17 May 2022 21:46:47 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
Prabhakar <prabhakar.csengg@...il.com>,
Phil Edworthy <phil.edworthy@...esas.com>,
Biju Das <biju.das.jz@...renesas.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [PATCH] Input: gpio-keys - Cancel delayed work only in case of
GPIO
Hi Lad,
On Fri, May 13, 2022 at 02:25:00PM +0100, Lad Prabhakar wrote:
> gpio_keys module can either accept gpios or interrupts. The module
> initializes delayed work in case of gpios only and not for interrupts,
> so make sure cancel_delayed_work_sync() is called only when bdata->gpiod
> is true.
...
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index d75a8b179a8a..ec9d50ddda42 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -133,7 +133,7 @@ static void gpio_keys_quiesce_key(void *data)
> hrtimer_cancel(&bdata->release_timer);
> if (bdata->debounce_use_hrtimer)
> hrtimer_cancel(&bdata->debounce_timer);
> - else
> + else if (bdata->gpiod)
> cancel_delayed_work_sync(&bdata->work);
We already have a check for bdata->gpiod a couple lines above. I think
the chunk should look like this:
if (!bdata->gpiod)
hrtimer_cancel(&bdata->release_timer);
else if (bdata->debounce_use_hrtimer)
hrtimer_cancel(&bdata->debounce_timer);
else
cancel_delayed_work_sync(&bdata->work);
since we use debounce timer/work only when we deal with gpio-backed
keys.
Thanks.
--
Dmitry
Powered by blists - more mailing lists