Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp946220rdb; Tue, 19 Sep 2023 15:31:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7fqrHsg2IgxlQh06q2RgoP56vFRKf6gnf5qmIuUY3SiI2kzXS0gZu8Qe3JmP0+DhAbS07 X-Received: by 2002:a17:902:82c4:b0:1c3:bc7c:e14c with SMTP id u4-20020a17090282c400b001c3bc7ce14cmr680411plz.32.1695162673108; Tue, 19 Sep 2023 15:31:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695162673; cv=pass; d=google.com; s=arc-20160816; b=CQKMbIswGQwDumsTXadi6Nv8QqYhpk0Fvzcd+ANmuLYHt85hXF80Y8VsBEVxY9NLGZ ee5viYOHsXX7L7fYfWNgNhIXLykZA86zeDpJyCyw1w+1rorfbQe9ZvEkJfYI7MXCrpu3 rX2i9FmibKE2vmsE4X9H1KYMad8BFqe+r3TF3R0CZcFoQh2h8wHAUHaKAPyLByk6FDE+ EF55Eh/jw7NK8OZSPV4tfbvNXJO2RRiJ2CW5RDjVkbeEp2WSfFcN1kaDol5QAm1Jvh1c ZFWiulbEuHsB0K0BjOcTVmePzCuZlc+fSW7Fr/DbUPaAjdydAqxzdH6g7CnwjBeaoSsf Leaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=/T8XS2Ui9mMPydYeKixs9wsR3zl0oPfxtqjgSiM2RKc=; fh=3H64tq5oQ3yIx4DRbbWoux7n6whtjaqrJuUgW3yvqR4=; b=CE+jnfMAkuBs6Fq4bJk1S7AGjvGyylxQZOLWfIrRvf+NtNFnoA8/58YxNAydpLaDBo W9t/XgtODQIY5tNAX47UabgpQeRjnBj8EgPNSVhq46edMxaqTOriHKuWjRHLik7hh+zz hsOL1jti0xG4X5I3/ay8CXGQ3vK1+agmez9v6d0R4aH7GjeFsLkwZ9rzVS2OkI6Z/ADP lkHLrPdJf6ccWFC00cC1gvud2RGtHPH2U8CG5/edwnYee7MSQPoQ1KytmLcGW4Qgomn2 ADPKETaqLWdIergqqOCnnok7N/Nimm5sb9eNmTQt6d7OVs77DmyIsblgLlj7hOCdayL0 zvSA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bp.renesas.com header.s=selector1 header.b="FXs/UPwc"; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dkim=pass dkdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id f2-20020a170902ce8200b001b8a56b9895si10893995plg.616.2023.09.19.15.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 15:31:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@bp.renesas.com header.s=selector1 header.b="FXs/UPwc"; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dkim=pass dkdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8758A83E8FE5; Tue, 19 Sep 2023 08:25:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233142AbjISPZJ (ORCPT + 99 others); Tue, 19 Sep 2023 11:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232823AbjISPZH (ORCPT ); Tue, 19 Sep 2023 11:25:07 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2109.outbound.protection.outlook.com [40.107.113.109]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED0D2E6B; Tue, 19 Sep 2023 08:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jDLuUaP3339RpZ+9a4HHddhzf11oY04g4t4klnpBKUubv11PeoAfc78eMHd2geO5il/e0Hmj+lj4ylyHcELH+r7O3Qt4BJeaPSMXzXGVXl3QX7iQVNbiyVBaqZI+wuXCQCKnkDoFn0b+s08G40/ksWZbIqtfxsVwzSGKjbGOlHglx313jPaj2t/ns6xPcN6yjk5GCRpNklyZkSV9Z5L5Ig+IRCXg2pdt3AgMHhqRGvOFER3rmcn+RYz5QRj1+HrSpfogfxuVu7avt+jplDmSXrodse2qFCrRCcAPWDJH47HT8vMPPeS8Vjd4znbrr8vvr1i+ejAP8b6OuXSOZET4hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/T8XS2Ui9mMPydYeKixs9wsR3zl0oPfxtqjgSiM2RKc=; b=PBsj11RQLW4/KZbBnhBN+Aiiq2DyZEvQM/ATSsmR86wHCY3jkyH2qZX33eXLSVoB/qU88NHU9J19lWoOrrWBStzZDbGnynFtx4WOGHcVOExT+qcLlIeiU/3xxPm55U876SsFk07TONhzo3M9W9/akTJs8NcWuxdyERkcq++0nd9cn4hpWx68FBVBn+nzCdw7thV+rHHTWBFVu05+ad8iA6ghGoNKue0+U8fiezunZ4IaPrK/ko+UF5mTX/iW9uo3c3/CfGQC6QSygKa6g/JL+PTYIJmE9Qm9/kJaZlYGL2DDsfyMxunu2PT85UQ4CvvAZ6VmWi/CmDvXd5XcywcSZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bp.renesas.com; dmarc=pass action=none header.from=bp.renesas.com; dkim=pass header.d=bp.renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bp.renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/T8XS2Ui9mMPydYeKixs9wsR3zl0oPfxtqjgSiM2RKc=; b=FXs/UPwc3aiMHa8RjUBssGbCIK985A9aA3huTNkmK0H81yj+StbO8XpFKFg5nxzKfubSavOXyEbJZscQ04hQLyp5JwWKbdV7W2nKWA2+5z4jVMfSvkB9gL9BvxHorlipuMK21RHMXP1QXcETtqPEf7Hw5ECqlPBqU5zjMSEogm0= Received: from OS0PR01MB5922.jpnprd01.prod.outlook.com (2603:1096:604:bb::5) by TYCPR01MB10333.jpnprd01.prod.outlook.com (2603:1096:400:241::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.27; Tue, 19 Sep 2023 15:24:57 +0000 Received: from OS0PR01MB5922.jpnprd01.prod.outlook.com ([fe80::9d23:32f5:9325:3706]) by OS0PR01MB5922.jpnprd01.prod.outlook.com ([fe80::9d23:32f5:9325:3706%5]) with mapi id 15.20.6792.026; Tue, 19 Sep 2023 15:24:53 +0000 From: Biju Das To: Marc Zyngier 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 Thread-Topic: [PATCH 3/3] irqchip: renesas-rzg2l: Fix irq storm with edge trigger detection for TINT Thread-Index: AQHZ6isSnZZc/iqk1kePfAP8iH4mBLAiOWYAgAALsBA= Date: Tue, 19 Sep 2023 15:24:53 +0000 Message-ID: References: <20230918122411.237635-1-biju.das.jz@bp.renesas.com> <20230918122411.237635-4-biju.das.jz@bp.renesas.com> <86y1h2cjpb.wl-maz@kernel.org> In-Reply-To: <86y1h2cjpb.wl-maz@kernel.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=bp.renesas.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: OS0PR01MB5922:EE_|TYCPR01MB10333:EE_ x-ms-office365-filtering-correlation-id: e5831a11-e63e-46bb-7f82-08dbb92492ee x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2cq3ugoSITNw7bF9+xGeomn+hkQ5O8lYLiWKo2u158L+8fXS525NQF0C63X44TV8ZRCq/mfzCly6CiEaV2dGk8B2QuuYL0p3hU/SbJbbfGg9VaxpBuOHh5lyPJee/wNPCxqilv5FC+RX7m+FNjKQr7jlQLyGVQ5WdBl3uhRoIdcTJMcIEhYHmlYqLsgap+TDw7kDMTd0Nf/Y6h4XJ7/en++f7LpX0SIon+Xn0DVpeMjFVP5uqnS/ENha402Ddah63ftsBwSrG91QYWxud/D2cLStH4w/pisVGudDRqYLQrOaQ5u/AzIwYhQGJOc0/hbRe61Uv1iyShVf2vH+rkrBsZAMsDr/9ayCt8d/8tGGD/FVKEKgBaAHPWQoP70/TxBiI9cljOZaVPqKC+Lq8yEtQMaoWxx7wWt/OngP/yuWIXMfWyE4LSPGMwo0EsKHZqXbKGX3fXcknd00sELLlNY8feJFCjQoZGJl8n2Z9+zV2R5Sli/6inKfwjx03rigLxTL36Q0P2wYnzvgdD4uCbhooelj8mKiAGI9ZhYXymrehzCGGaaaFa0CXmkUvSmJ8WecpXdY3YXYSq0Ll4E2V3WZteopnjB+68HcJe/JP17ahp67oJucwapMdUTCcR7uBgjs x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS0PR01MB5922.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(136003)(39860400002)(366004)(376002)(451199024)(1800799009)(186009)(6506007)(478600001)(5660300002)(71200400001)(55016003)(26005)(316002)(83380400001)(52536014)(86362001)(2906002)(7696005)(122000001)(54906003)(64756008)(66446008)(9686003)(76116006)(41300700001)(6916009)(66946007)(38100700002)(66476007)(66556008)(4326008)(38070700005)(8676002)(8936002)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1HwhDSQvBbD7yZIPJZ5ZIBdfXnj4pNSn5pF5Q0bl6sIHU1YfWmZuHiMIJueN?= =?us-ascii?Q?ZlhaE96IUJ97yfSdYPTSF6SpdA6P+Hwt1357GIHN1ZOZ5MFbf7ObubUXlGjT?= =?us-ascii?Q?xPTm3O6WdNb1ioLnPaFTdcvOEsbpSAmU3ZaltqSjO/CsNrMBjDOWd8VG0LlR?= =?us-ascii?Q?TE1aghc53v1nllr+6WLhOMBDfIBisQcWuuIG/5uJLQ/5UzQHUhSk4Xx+ckIj?= =?us-ascii?Q?lasogruqWNe6j3KZak1cl0wOipbfQIDS8yR6G21pwHxVpANEsl925nbmnnCi?= =?us-ascii?Q?7E18gAIRM/DJBeVKxdchyEb6YapgVwmZ8brHBOfP6Ooi6nqExwTldE8nVATB?= =?us-ascii?Q?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OyMfLScx6eg5U?= =?us-ascii?Q?9BCbEuuRcf4FUcV2XYuVTTFNgk0g7O8BJOVMhNXCunusUWBBmAqeBOc6hgT0?= =?us-ascii?Q?ZSECAv9s/TYyBLGZsJm6SAl6hgbjCKV5SLaD+P3AjLAk4y2ivcaL3F5i6nkq?= =?us-ascii?Q?QiY779gqazrTjLew0mHNztycp8hF3iYf9StXBb7CVneQLZ9bKxe+S8MPeudL?= =?us-ascii?Q?U2n2i2qvB0SILqq9Mrj5G435NzUN+R0RntFvC8CKHqtptXsnkwdX1sqazd35?= =?us-ascii?Q?BjWbkB1WcrzIUA64n5ZVLvy36jBvM/EwaLzM4o5Bj4OZ3Kda2nn9uU1Ts4WQ?= =?us-ascii?Q?isclBmym4fskI/J0pOkcLBWF0KMNZ0EzJQ2PAHwsYM7Q/vyjpegzc3tBQ69F?= =?us-ascii?Q?gA=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: bp.renesas.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OS0PR01MB5922.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5831a11-e63e-46bb-7f82-08dbb92492ee X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2023 15:24:53.7832 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PgjD2Es93vjGuDFUjv5PxNmbobBgylglj0VCgunQ6vtoNkPMdrxWGQVOsVOXPwMoqoYQEidle9f0M/32FdbRn/o1uPtt9GkpK0BKWbFHv+Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB10333 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Tue, 19 Sep 2023 08:25:08 -0700 (PDT) Hi Marc Zyngier, Thanks for the feedback. > Subject: Re: [PATCH 3/3] irqchip: renesas-rzg2l: Fix irq storm with edge > trigger detection for TINT >=20 > On Mon, 18 Sep 2023 13:24:11 +0100, > Biju Das wrote: > > > > In case of edge trigger detection, enabling the TINT source causes a > > phantum interrupt that leads to irq storm. So clear the phantum > > interrupt in rzg2l_irqc_irq_enable(). > > > > This issue is observed when the irq handler disables the interrupts > > using > > disable_irq_nosync() and scheduling a work queue and in the work > > queue, re-enabling the interrupt with enable_irq(). > > > > Fixes: 3fed09559cd8 ("irqchip: Add RZ/G2L IA55 Interrupt Controller > > driver") > > Signed-off-by: Biju Das > > Tested-by: Claudiu Beznea > > --- > > drivers/irqchip/irq-renesas-rzg2l.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/irqchip/irq-renesas-rzg2l.c > > b/drivers/irqchip/irq-renesas-rzg2l.c > > index 33a22bafedcd..78a9e90512a6 100644 > > --- a/drivers/irqchip/irq-renesas-rzg2l.c > > +++ b/drivers/irqchip/irq-renesas-rzg2l.c > > @@ -144,6 +144,12 @@ static void rzg2l_irqc_irq_enable(struct irq_data > *d) > > reg =3D readl_relaxed(priv->base + TSSR(tssr_index)); > > reg |=3D (TIEN | tint) << TSSEL_SHIFT(tssr_offset); > > writel_relaxed(reg, priv->base + TSSR(tssr_index)); > > + /* > > + * In case of edge trigger detection, enabling the TINT source > > + * cause a phantum interrupt that leads to irq storm. So clear > > + * the phantum interrupt. > > + */ > > + rzg2l_tint_eoi(d); >=20 > This looks incredibly unsafe. disable_irq()+enable_irq() with an interrup= t > being made pending in the middle, and you've lost that interrupt. In this driver that will never happen as it clears the TINT source during disable(), so there won't be any TINT source for interrupt detection= after disable(). Cheers, Biju > What prevents this scenario?