linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Paul Cercueil <paul@crapouillou.net>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: gpio-keys - fix crash when disabliing GPIO-less buttons
Date: Wed, 7 Apr 2021 09:05:30 +0300	[thread overview]
Message-ID: <YG1Lqra86g3GekmG@atomide.com> (raw)
In-Reply-To: <YG1DFFgojSVfdpaz@google.com>

* Dmitry Torokhov <dmitry.torokhov@gmail.com> [210407 05:30]:
> My brain-damaged adjustments to Paul's patch caused crashes in
> gpio_keys_disable_button() when driver is used in GPIO-less (i.e.
> purely interrupt-driven) setups, because I mixed together debounce and
> release timers when they are in fact separate:
> 
> Unable to handle kernel NULL pointer dereference at virtual address 0000000c
> ...
> PC is at hrtimer_active+0xc/0x98
> LR is at hrtimer_try_to_cancel+0x24/0x140
> ...
> [<c01c43b8>] (hrtimer_active) from [<c01c50f4>] (hrtimer_try_to_cancel+0x24/0x140)
> [<c01c50f4>] (hrtimer_try_to_cancel) from [<c01c5224>] (hrtimer_cancel+0x14/0x4c)
> [<c01c5224>] (hrtimer_cancel) from [<bf1cae24>] (gpio_keys_attr_store_helper+0x1b8/0x1d8 [gpio_keys])
> [<bf1cae24>] (gpio_keys_attr_store_helper [gpio_keys]) from [<bf1cae80>] (gpio_keys_store_disabled_keys+0x18/0x24 [gpio_keys])
> [<bf1cae80>] (gpio_keys_store_disabled_keys [gpio_keys]) from [<c038ec7c>] (kernfs_fop_write_iter+0x10c/0x1cc)
> [<c038ec7c>] (kernfs_fop_write_iter) from [<c02df858>] (vfs_write+0x2ac/0x404)
> [<c02df858>] (vfs_write) from [<c02dfaf4>] (ksys_write+0x64/0xdc)
> [<c02dfaf4>] (ksys_write) from [<c0100080>] (ret_fast_syscall+0x0/0x58)
> 
> Let's fix it up.
> 
> Fixes: c9efb0ba281e ("Input: gpio-keys - use hrtimer for software debounce, if possible")
> Reported-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> 
> Tony, could you please try this patch and see if it fixes the crash you
> observed?

Yes great, thanks this works for me:

Tested-by: Tony Lindgren <tony@atomide.com>

      reply	other threads:[~2021-04-07  6:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07  5:28 [PATCH] Input: gpio-keys - fix crash when disabliing GPIO-less buttons Dmitry Torokhov
2021-04-07  6:05 ` Tony Lindgren [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=YG1Lqra86g3GekmG@atomide.com \
    --to=tony@atomide.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@crapouillou.net \
    /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).