Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp93226ybf; Wed, 26 Feb 2020 09:24:00 -0800 (PST) X-Google-Smtp-Source: APXvYqyzwTm2psC6TE3RzxlEyxW7UfcdrKM7UQCFnj4deMWXIyT8T4w1/Wh0AMSW7kB2gah/n+ch X-Received: by 2002:aca:2813:: with SMTP id 19mr57088oix.76.1582737840343; Wed, 26 Feb 2020 09:24:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582737840; cv=none; d=google.com; s=arc-20160816; b=pBEvFUSjNpB/vPWx3yGahmJ0HUTBbYH5wUwlBthuD5nVzvNRFEe9eePmJYqaqi3VyQ DN6LDYN6deKbQJc/QdrefpQf06fw2Kk+3W7oTmBT7U8IF+7JI8Anv4rrYK30EAi3qnog 6g+sOYj89PClUNmxdbdnoAcuCebooF2VS5BltBb8kGeV8p67JlI6QAUzVE6Qml+0ucsh OED5Dfxibu7aSI9WJfX3BsiuIQBZ+d/Fb1alsENCGWtpW+insE91USfbSvLHZ+1Iv8Hu GKv4BWcLGYcu/oa3n4oRmtwm8ArApRM4Z7knUPBEhqA4HkdStEbGwXI4BsQ+BjJFOEUV lNAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=aLmTyqAd/P94kRIyBjL+cb/Y+cTLarFng2zpE1bkPwE=; b=QiihzbgVS5c80FLxeddZXo40M/rwkHiIin6jmWHj6gKCiDQvtvdWE2M2g9AADSMK1e /aVMsWnQkPis/3BaLl3sdpl1mRvnNRmP+hG4dJEKGPPE5P1ekAbMzWYV1cJLFFUuKSHM LyqJHG1crQ0MPaZuaf7r4FvNgUled0JxQd5cjHyZHMFagM1KcKxuYfOiyJrm+mhvk9yX 3ZgqvlIZPHXTXRDcpRYtCHyrUPTnvOeYHda5wSGjo+LcvnjrM2gUdRxjIOHPf46pHCtT k02Rggu4HWQNnMNUmNm9XZa/WP3BZnuZ7UoVk5ri63fZLitcwwUwDTsO1wdE2QD9xhXG LG4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s22si1533893oij.35.2020.02.26.09.23.48; Wed, 26 Feb 2020 09:24:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbgBZRX0 (ORCPT + 99 others); Wed, 26 Feb 2020 12:23:26 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38742 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbgBZRXZ (ORCPT ); Wed, 26 Feb 2020 12:23:25 -0500 Received: by mail-wr1-f68.google.com with SMTP id e8so4098402wrm.5; Wed, 26 Feb 2020 09:23:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=aLmTyqAd/P94kRIyBjL+cb/Y+cTLarFng2zpE1bkPwE=; b=U9mCjIWtwLbZtWh/eWgnPNP7lrTs1AJEZUNGnIwreIeBB/1Xo1px4bvLuMHzWgu5Ro +n+LTCC+FLWa7CX8wWw0XI/j5xBRkQTXzdbQxbZEq1fH+muqeA22bmxa/i6dyrUVFZPr I7Jr/37vMSpEdqt4ova00n28gHvUaWWbNl7EFoyqLZU6a3WF7mQEEbRs987Dmln2u2TI pIDMy7AjBobcCTrjcFYRf4ILOgrWDDsv6TbnJ08zD4fdNT4AYOWFn5srgkkMnN6rBFP0 l+TbExYwpP44QMtX7+Lv1m7DrrMv5M+dUef/g9quDkSYYEhR8dNgFLIrkhgxxUHqPESf 3x9Q== X-Gm-Message-State: APjAAAV6sF1NilPzM0HWylJep4ro2X+JS1WocAoOhGin0xwa5v59UqnJ oaKYaP5Z1f+8Qz5pudDunlk= X-Received: by 2002:adf:f3d1:: with SMTP id g17mr6281250wrp.378.1582737803473; Wed, 26 Feb 2020 09:23:23 -0800 (PST) Received: from tfsielt31850 ([77.107.218.170]) by smtp.gmail.com with ESMTPSA id j12sm4121316wrt.35.2020.02.26.09.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 09:23:22 -0800 (PST) Message-ID: Subject: Re: [PATCH v2 6/6] Input: snvs_pwrkey - only IRQ_HANDLED for our own events From: =?ISO-8859-1?Q?Andr=E9?= Draszik To: Robin Gong Cc: Horia Geanta , Aymen Sghaier , Herbert Xu , "David S. Miller" , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , dl-linux-imx , Dmitry Torokhov , Anson Huang , "linux-crypto@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Wed, 26 Feb 2020 17:23:21 +0000 In-Reply-To: References: <20200225161201.1975-1-git@andred.net> <20200225161201.1975-6-git@andred.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-02-26 at 01:15 +0000, Robin Gong wrote: > On 2020/02/26 André Draszik wrote: > > The snvs_pwrkey shares the SNVS LPSR status register with the snvs_rtc. > > > > This driver here should only return IRQ_HANDLED if the status register > > indicates that the event we're handling in the irq handler was genuinely > > intended for this driver. Otheriwse the interrupt subsystem will assume the > > interrupt was handled successfully even though it wasn't at all. > > > > Signed-off-by: André Draszik > > Cc: "Horia Geantă" > > Cc: Aymen Sghaier > > Cc: Herbert Xu > > Cc: "David S. Miller" > > Cc: Rob Herring > > Cc: Mark Rutland > > Cc: Shawn Guo > > Cc: Sascha Hauer > > Cc: Pengutronix Kernel Team > > Cc: Fabio Estevam > > Cc: NXP Linux Team > > Cc: Dmitry Torokhov > > Cc: Anson Huang > > Cc: Robin Gong > > Cc: linux-crypto@vger.kernel.org > > Cc: devicetree@vger.kernel.org > > Cc: linux-arm-kernel@lists.infradead.org > > Cc: linux-input@vger.kernel.org > > > > --- > > v2: > > * no changes > > --- > > drivers/input/keyboard/snvs_pwrkey.c | 12 +++++++----- > > 1 file changed, 7 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/input/keyboard/snvs_pwrkey.c > > b/drivers/input/keyboard/snvs_pwrkey.c > > index 382d2ae82c9b..980867886b34 100644 > > --- a/drivers/input/keyboard/snvs_pwrkey.c > > +++ b/drivers/input/keyboard/snvs_pwrkey.c > > @@ -82,7 +82,9 @@ static irqreturn_t imx_snvs_pwrkey_interrupt(int irq, void > > *dev_id) > > clk_enable(pdata->clk); > > > > regmap_read(pdata->snvs, SNVS_LPSR_REG, &lp_status); > > - if (lp_status & SNVS_LPSR_SPO) { > > + lp_status &= SNVS_LPSR_SPO; > > + > > + if (lp_status) { > > if (pdata->minor_rev == 0) { > > /* > > * The first generation i.MX[6|7] SoCs only send an @@ -98,14 > > +100,14 @@ static irqreturn_t imx_snvs_pwrkey_interrupt(int irq, void > > *dev_id) > > mod_timer(&pdata->check_timer, > > jiffies + msecs_to_jiffies(DEBOUNCE_TIME)); > > } > > - } > > > > - /* clear SPO status */ > > - regmap_write(pdata->snvs, SNVS_LPSR_REG, SNVS_LPSR_SPO); > > + /* clear SPO status */ > > + regmap_write(pdata->snvs, SNVS_LPSR_REG, SNVS_LPSR_SPO); > But irq storm will come in once there is other interrupt triggered as unexpected, > although I never met it before. Could we drop this patch now? Others are ok for me. I don't have strong feelings about this patch, but this bit merely changes behaviour to clear SP0 if SP0 was in fact != 0 in the first place, whereas before SP0 was always cleared, even if it was == 0 anyway. Seems more logical in my eyes. > Reviewed-by: Robin Gong > > + } > > > > clk_disable(pdata->clk); > > > > - return IRQ_HANDLED; > > + return lp_status ? IRQ_HANDLED : IRQ_NONE; If you're talking about this part, the rtc-snvs driver does the same in its interrupt handler. In other words, this driver here could prevent the rtc-snvs driver from seeing its events. Cheers, Andre' > > } > > > > static void imx_snvs_pwrkey_act(void *pdata) > > -- > > 2.23.0.rc1