All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	linux-input@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Phil Edworthy <phil.edworthy@renesas.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] Input: gpio-keys - Cancel delayed work only in case of GPIO
Date: Thu, 19 May 2022 05:58:38 +0100	[thread overview]
Message-ID: <CA+V-a8si1uD5FgmpRfjfQ9FnarCA0_Fn2SMKJfw4nVZ=4iui4Q@mail.gmail.com> (raw)
In-Reply-To: <YoR6N2ACf3TZr1P5@google.com>

Hi Dmitry,

Thank you for the review.

On Wed, May 18, 2022 at 5:46 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> 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.
>
Agreed, will fix that in v2.

Cheers,
Prabhakar

      reply	other threads:[~2022-05-19  4:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 13:25 [PATCH] Input: gpio-keys - Cancel delayed work only in case of GPIO Lad Prabhakar
2022-05-17  7:33 ` Geert Uytterhoeven
2022-05-18  4:46 ` Dmitry Torokhov
2022-05-19  4:58   ` Lad, Prabhakar [this message]

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='CA+V-a8si1uD5FgmpRfjfQ9FnarCA0_Fn2SMKJfw4nVZ=4iui4Q@mail.gmail.com' \
    --to=prabhakar.csengg@gmail.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=phil.edworthy@renesas.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.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 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.