From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D97A1C433ED for ; Wed, 7 Apr 2021 06:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5BF061074 for ; Wed, 7 Apr 2021 06:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345349AbhDGGFq (ORCPT ); Wed, 7 Apr 2021 02:05:46 -0400 Received: from muru.com ([72.249.23.125]:51744 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237120AbhDGGFo (ORCPT ); Wed, 7 Apr 2021 02:05:44 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id D2BE880A4; Wed, 7 Apr 2021 06:06:42 +0000 (UTC) Date: Wed, 7 Apr 2021 09:05:30 +0300 From: Tony Lindgren To: Dmitry Torokhov Cc: Paul Cercueil , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Input: gpio-keys - fix crash when disabliing GPIO-less buttons Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org * Dmitry Torokhov [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 > ... > [] (hrtimer_active) from [] (hrtimer_try_to_cancel+0x24/0x140) > [] (hrtimer_try_to_cancel) from [] (hrtimer_cancel+0x14/0x4c) > [] (hrtimer_cancel) from [] (gpio_keys_attr_store_helper+0x1b8/0x1d8 [gpio_keys]) > [] (gpio_keys_attr_store_helper [gpio_keys]) from [] (gpio_keys_store_disabled_keys+0x18/0x24 [gpio_keys]) > [] (gpio_keys_store_disabled_keys [gpio_keys]) from [] (kernfs_fop_write_iter+0x10c/0x1cc) > [] (kernfs_fop_write_iter) from [] (vfs_write+0x2ac/0x404) > [] (vfs_write) from [] (ksys_write+0x64/0xdc) > [] (ksys_write) from [] (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 > Signed-off-by: Dmitry Torokhov > --- > > 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