Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp623737pxf; Wed, 7 Apr 2021 07:52:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylBK5mZuvQFt59rRWENETUsxPgO/a69PgGGmbGI7ZORagMFYA+44oJvdfeNtXgh8lk8QRR X-Received: by 2002:a05:6402:350f:: with SMTP id b15mr4883948edd.6.1617807123482; Wed, 07 Apr 2021 07:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617807123; cv=none; d=google.com; s=arc-20160816; b=cgMTCIbtbUWKav6aMy4vEp9KV1LLBMVngyQgifN5I4RNIW5F7C9Pkb9udkWU0KUBtT YQ4dwck9zI5p+se+/tlgb4qFHTEm0Pn+cCESyq6TixpFvxFivYlR02hmSzA+MyhYBOic CqpfazSh9Ac7Vul3XwcigM0179xxvfOZMFchgs1wKxyy92Y4TFDeTTe30mw9KXx5+/4K E331V2U2L61hj5dVq2wmOR4PhpDcar+mnXkhkcEMh+Xw1Zrm2Vqe9ggu/2MrrHbJp2oZ TjbVLtQShcOHwGNBoEmVA5wOHPUZxghGCdHbqWhOH3vIOjbrh3iWwhV54PnYSAloQeJ/ WjEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=pQcTmEUlqb8vm93cydaV9EI57OkScxLh4dluEj7FGsQ=; b=B/5Pd4QI59j1x//eI+GMkAah4OosWGUY1AMQsXoIZ2z+5BrcdRCBF27c8ZRzJ8wylg btmKQztD/NlUc+Bhob/NbRaJaO3gmXoIjnOY+Qkeg8yet0FCCsrDoU/tRbOS5Mqm06KF bsyB98yEin6S6g7VvjkxpCH71SFOinqH1o0opCvU2yP79vLMD/aPBO1k8FSEo/t5EwT1 HLfFoQMUr70Uc2jRZMn/lCHN1rQdEroSTHAiMZHfqhqTg5GOD/FtyqDrBbNIuX1BRpPt D8fLd24/cDWEnr0wbNP2lWd5kCDHhfGiQe/cF5Dp2CPB9pIPTZgh7VpEsROfWER1ZNT3 2ntg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bq23si14131746edb.111.2021.04.07.07.51.38; Wed, 07 Apr 2021 07:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345374AbhDGGFr (ORCPT + 99 others); Wed, 7 Apr 2021 02:05:47 -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-kernel@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