Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2192235rdb; Thu, 21 Sep 2023 11:02:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLSAd+LVgzHVc9/gk8AQyN3+crB4zc46z6KgV9wN+h0H3r/NLvzbdgUI1vk0YCQJATGeLU X-Received: by 2002:a05:6a00:13a9:b0:690:1c1b:aefd with SMTP id t41-20020a056a0013a900b006901c1baefdmr7663838pfg.5.1695319357854; Thu, 21 Sep 2023 11:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695319357; cv=none; d=google.com; s=arc-20160816; b=kF/ULr3QH+tuZAXI9MLHc9poQ0yPG9bi5JE//9nrWvSaO/aObifo1zTEhTkDd6KDTH L9h50MEvovldPzVnmUOo43V89aIvzVO3XRjs/B2Q/bdYKiwc66Q2W+0w95smIS/zqjAs +azzkxaOtW7L30E2YjIl5XFkCbWjg79E63gjlpVIRtNl3MU2vrw4b7XbpHwIduuWxn7L ooHLehwDKrOXj8bY5NeS2RuIIoJmkE4SN6uygL6v5xJDgbKqdOW2kstgmu+3WAriWqvX gZGiZMk45bf0UNAdOoeTY0Fjzw1z26nU1+PMmK1jQOFbN1DDmuehcLW2aiJE/DvAyneR sYGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=UaEVonUAYWgGWSpgNOzlKUjlFTiXRAape8k2bXoo4MI=; fh=SkpZksHjzZAw08SQ4GWYM1zwE4MQe+gVw/De8CatwzE=; b=dJl6riBiYh7xmFJGyt+HjPNfEzyhXxrZAayuiJPz5Qfj5fmJUa3Yq+z5BA3pyKYaHS VBYdEyAggJqi4JGyTbshvCnKU1MTJjTjn6LxTBtK6NvT3a2MsKaRDqNVsJQH7GdgTUDz PPR7B7jDKErHUUINKzjB/ljS7/mt6n9HIn7qRkSkfsXWYh9GxqCNKsPZA262M+RQDsmW /HqJmx6aOCx/QA7+OAx6sjlNJBGx3m6yAG8xZPPiFkd/D7xvkPl6xVZHdz5/3WH2NYZC B5heO+fhbXmiJpeorBeaP/2Gu+vDhtShqlQwwHrJbMjqhwGNlDvqABYU1KBy7vnIWUjp VocQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QNsk4p+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id f1-20020a056a00228100b0068ffa414ea1si2062842pfe.298.2023.09.21.11.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 11:02:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QNsk4p+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CAA7883524C5; Thu, 21 Sep 2023 10:51:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbjIURvq (ORCPT + 99 others); Thu, 21 Sep 2023 13:51:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjIURv0 (ORCPT ); Thu, 21 Sep 2023 13:51:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C7F26E99; Thu, 21 Sep 2023 10:22:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9943EC07618; Thu, 21 Sep 2023 07:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695282918; bh=qvPZ+VCJtPMejE6viuglDi8nXd8o5MD4A3HkT/J6twY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QNsk4p+/lZjcd6Y+rEjxn/UjnbFW/kFDV0pOQKYpCebciHdwyv7OJO2WDztsBPMSd DTLx1JsTnmBClOEJBWftMLGYMD1XwFqb7lW3I4VCRDOZUSqRna9Ltrb+gGUVFX5d5O rKESmAfK4AhmKkPRFk1VK0y6TfkH81F36AsznQ/0R36tHoqTN/EkjsNOfNam0ShW1S aDZOmJDtOB2ij2jtE4cxaGw+Qh9QBHKboq9CiJIUPgRVlx3HFsLUrc6u/6jbZoSAi+ c72Szhe25QJZSuX2G9nU5HENKtvkr8UMDwhuBhCMLmUp76a0UxAjry62rIer69adY7 NpYkARY2O0TEg== Received: from 82-132-232-12.dab.02.net ([82.132.232.12] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qjEWp-00EsBY-9W; Thu, 21 Sep 2023 08:55:16 +0100 Date: Thu, 21 Sep 2023 08:55:10 +0100 Message-ID: <871qes3qqp.wl-maz@kernel.org> From: Marc Zyngier To: Biju Das Cc: Thomas Gleixner , Prabhakar Mahadev Lad , Claudiu Beznea , Geert Uytterhoeven , Biju Das , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" Subject: Re: [PATCH 3/3] irqchip: renesas-rzg2l: Fix irq storm with edge trigger detection for TINT In-Reply-To: References: <20230918122411.237635-1-biju.das.jz@bp.renesas.com> <20230918122411.237635-4-biju.das.jz@bp.renesas.com> <86y1h2cjpb.wl-maz@kernel.org> <87cyye3zly.wl-maz@kernel.org> <87a5ti3y7i.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 82.132.232.12 X-SA-Exim-Rcpt-To: biju.das.jz@bp.renesas.com, tglx@linutronix.de, prabhakar.mahadev-lad.rj@bp.renesas.com, claudiu.beznea.uj@bp.renesas.com, geert+renesas@glider.be, biju.das.au@gmail.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 21 Sep 2023 10:51:48 -0700 (PDT) On Tue, 19 Sep 2023 18:06:54 +0100, Biju Das wrote: > > Hi Marc Zyngier, > > > Subject: Re: [PATCH 3/3] irqchip: renesas-rzg2l: Fix irq storm with edge > > trigger detection for TINT > > > > On Tue, 19 Sep 2023 17:32:05 +0100, > > Biju Das wrote: > > > > [...] > > > > > > So you mean that you *already* lose interrupts across a disable > > > > followed by an enable? I'm slightly puzzled... > > > > > > There is no interrupt lost at all. > > > > > > Currently this patch addresses 2 issues. > > > > > > Scenario 1: Extra interrupt when we select TINT source on enable_irq() > > > > > > Getting an extra interrupt, when client drivers calls enable_irq() > > > during probe()/resume(). In this case, the irq handler on the Client > > > driver just clear the interrupt status bit. > > > > > > Issue 2: IRQ storm when we select TINT source on enable_irq() > > > > > > Here as well, we are getting an extra interrupt, when client drivers > > > calls enable_irq() during probe() and this Interrupts getting > > > generated infinitely, when the client driver calls disable_irq() in > > > irq handler and in in work queue calling enable_irq(). > > > > How do you know this is a spurious interrupt? > > We have PMOD on RZ/G2L SMARC EVK. So I connected it to GPIO pin > and other end to ground. During the boot, I get an interrupt > even though there is no high to low transition, when the IRQ is setup > in the probe(). From this it is a spurious interrupt. That doesn't really handle my question. At the point of enabling the interrupt and consuming the edge (which is what this patch does), how do you know you can readily discard this signal? This is a genuine question. Spurious interrupts at boot are common. The HW resets in a funky, unspecified state, and it's SW's job to initialise it before letting other agents in the system use interrupts. > > > For all you can tell, you are > > just consuming an edge. I absolutely don't buy this workaround, because you > > have no context that allows you to discriminate between a real spurious > > interrupt and a normal interrupt that lands while the interrupt line was > > masked. > > > > > Currently we are not loosing interrupts, but we are getting additional > > > Interrupt(phantom) which is causing the issue. > > > > If you get an interrupt at probe time in the endpoint driver, that's > > probably because the device is not in a quiescent state when the interrupt > > is requested. And it is probably this that needs addressing. > > Any pointer for addressing this issue? Nothing but the most basic stuff: you should make sure that the interrupt isn't enabled before you can actually handle it, and triage it as spurious. M. -- Without deviation from the norm, progress is not possible.