Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1104463rdh; Mon, 25 Sep 2023 03:31:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGESUTXd6VdbGdKzwZpKuk9hP8IfhMafN69An2LLoSlBe+/V9+cCh+g1RfKNqfuWCGn9EJX X-Received: by 2002:a05:6a20:3947:b0:15e:a653:fed5 with SMTP id r7-20020a056a20394700b0015ea653fed5mr4368759pzg.16.1695637872982; Mon, 25 Sep 2023 03:31:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695637872; cv=pass; d=google.com; s=arc-20160816; b=rHps6o4cDLfH5eZSJ7shvws+73ZSl8B5H71q9DeZAbZXVI8DOpZEtdWv6WFzy77nMk J8QmTJBtUyNCF6KOWtQH3f8bYLOH858aDQLOoeTE65gdm9AhSWBpPjoSfQQDd8WU/375 LGg/maThDh1sorUFdmOOmmADeIXlcuVmAvG9G3o8Dwgd/214+p6XCjzvHWU7INdBZe9T m599QpS7Mim+IWaSteGbJ41JuCfGQta+OVBcZolA5iUM1yPZfpSrK58QypAe+FYiumXZ jU7wStLpDTUS9f3pSvtyTKNpTQ6XCIDE51aFdQbLL+QAaiDQfvf6cZOhgWQyp3PLz/cm F6/g== 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=xgLM5HQHJrWJ/XvH/PowRg+BmNP6m6Bu7Jk/o9Ej61A=; fh=3H64tq5oQ3yIx4DRbbWoux7n6whtjaqrJuUgW3yvqR4=; b=itZM6qnzcwXlASVrd4Tk8QPIaWgBx5Gh225yGG39m8TBJ1+nobhR+dszCSmF/3RO7W ss/2prc2bspj1WVrZ0+X2ztXe/9rnwiR8V8qEVh/OuB0iUxWwe0yfWLmSCVVNnduF6vL OdMCY/8svd8MmlGza/z7c7mPSq/mcwgz98Igs5dHy3pomARGGoPhrRwAPEzAtKdej+R0 w6n8tAB4iD++EK2/mo179Xzaf0fk+WeynlMKkqqd5E3qM5l7efxy4OT8VsZIE64iblAR TSSeoVKO+W3avqsnqfY76Dkp3s31onJBbf3ILF4EsfH3+DV4R4iQ/xR18fGB/SclQlzQ mVYQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bp.renesas.com header.s=selector1 header.b=MhEdEiGq; 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:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ay14-20020a056a00300e00b0068e4358d041si9619676pfb.175.2023.09.25.03.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 03:31:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@bp.renesas.com header.s=selector1 header.b=MhEdEiGq; 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:6 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 pete.vger.email (Postfix) with ESMTP id 149DC8076D26; Mon, 25 Sep 2023 01:52:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233030AbjIYIwE (ORCPT + 99 others); Mon, 25 Sep 2023 04:52:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232970AbjIYIwC (ORCPT ); Mon, 25 Sep 2023 04:52:02 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2103.outbound.protection.outlook.com [40.107.113.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762B6AB; Mon, 25 Sep 2023 01:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M6yvftVHmR12yl3o4Y4Jo4IBV7FeM4jYd57ZTIb+FFUzHnw/CySZayZA39wfVysT9FvkCD5blsCvHz4i9UAhzyTJb1v51UqVj7qZbscJKdS/p8473Ll0i3f1lkEZYQt1D1+/qXCFBvbV+Tc6spN8vFk1XaqsWE7lJ4mbG1jewhTCNEbq6S6HzDpne5Dm/F3KHo/yLg9hASLB0JW0YXJMcQcfkvOPuzxQ9oitwX6CLo028hmXxQObf6GEt3orGoS0FQ1KYCXINsHLlHBPPiO9j390d0+cZr7vIsjhqwOdC+gfX4JxwKtqiSwjt0HZLX/DL88LVGOI/tBLt4Gyu75tQw== 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=xgLM5HQHJrWJ/XvH/PowRg+BmNP6m6Bu7Jk/o9Ej61A=; b=G5I6/UOlwGQJcahhhVMb4Qww3iYfU+1pVcRzggWbyMvSLMSF1/5LHuufuo1mSti9IdL9EMtbNvNhHdyT3US/1QhGYq9ok0TNlSZjT2Hux9VCiJLtFuWX8tUQIxziFpembtCUhgoHq31Y2BsvQaE/bb8RaBIRfaA9Uba/RgOeWZoXabLMY8cmevwChCDaFoWTZtIBo91vFtfO1FiGbGCrICdtuhApy2c+M+r7SCdUhGHEj0XhH056f1AxnuenDru4Nqj70yUjIrtLq+AL3eD+F/d5Py/WuWExRHQOWzxFqix3SqEzyAbT0d7JwzFuSbRXJ7ouzLIRJsvMkovGYx03EA== 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=xgLM5HQHJrWJ/XvH/PowRg+BmNP6m6Bu7Jk/o9Ej61A=; b=MhEdEiGq3ZjShiuPhKBkzh2zqmYbEoneoAeoTzhCz7W8mL61yTeP2gE57eyr+hmwkbA3L8Koiv7TAuNW7wSVeqApI9CRfbpJa08GWRYgoTIcFWJTnsoZJM5b+zfNx1NiMzbA+M2/Z69g5AfNI9gOYimXEvkcjWFTcS8fMVuetK0= Received: from OS0PR01MB5922.jpnprd01.prod.outlook.com (2603:1096:604:bb::5) by TYWPR01MB10322.jpnprd01.prod.outlook.com (2603:1096:400:1e6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Mon, 25 Sep 2023 08:51:50 +0000 Received: from OS0PR01MB5922.jpnprd01.prod.outlook.com ([fe80::fb78:2e8c:f7f9:5629]) by OS0PR01MB5922.jpnprd01.prod.outlook.com ([fe80::fb78:2e8c:f7f9:5629%6]) with mapi id 15.20.6813.027; Mon, 25 Sep 2023 08:51:50 +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 2/3] irqchip: renesas-rzg2l: Mask interrupts for changing interrupt settings Thread-Topic: [PATCH 2/3] irqchip: renesas-rzg2l: Mask interrupts for changing interrupt settings Thread-Index: AQHZ6isQu3885mmag0K4fbtCicuaxbApvkOAgAGGVSA= Date: Mon, 25 Sep 2023 08:51:50 +0000 Message-ID: References: <20230918122411.237635-1-biju.das.jz@bp.renesas.com> <20230918122411.237635-3-biju.das.jz@bp.renesas.com> <87wmwf53bi.wl-maz@kernel.org> In-Reply-To: <87wmwf53bi.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_|TYWPR01MB10322:EE_ x-ms-office365-filtering-correlation-id: 0e960588-da6f-49c4-223d-08dbbda4a89a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ezJAPZJZo2OZLwEAzliY/EOxZevjxTcUkIF/Te9rdojN0wlFSseLXqM8I2/TzF00PrnhD8Zgjvs+s/4VUxq2M1PGMEpRp3H0bGyscAKj9puxmKJghrNDlYDLRCaMUKEwfh83PPEIChNtg/qoY/HZ6A1eOCdC1DnxzQqABUimTC2siNO7s3LRwcNRdyoC2grmI7tV+e/XMHI9TUeG3t3X4yWIoaaZHn7D40CAuEA/TfWPI/F208uii811itXwC9Ee5RQqfPYz8trjqbZMB0hM30sCOCk5jIOaTqJJ7GwmebdzoK3+qbhu0ImOeXPdJsSoAnpSIZ8DLIzQq5kmZzZHt0QTP3zjGgwBk8vpGD4zZgadBKSE+mFtnnERGa7ZgNpnEfHTuNQBs0cHW9yxgoJbHOQOqGdJQCxUXDP1OMxeCGOIHwX8lchorJ+yNtZoanOSkbauwGUuLolnJNkz5iI8pOp+f+/CEkLcyEf0ol230RgwhxG+Z6mzC85qd1Ft4Tbq+5Ry9o6/OTX0535SpZEs1RzDVfumSI72iiYIwEDVldqzgUD+tEAoIsg0Mg6LzdDkT8Yjmur3s8bh/2NOGdTOhQlzz6M40hFKpwvKviBtQTDcxWfDy6Xam40pqT6ayS4u 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)(39860400002)(136003)(346002)(366004)(376002)(396003)(230922051799003)(1800799009)(186009)(451199024)(33656002)(122000001)(38100700002)(38070700005)(86362001)(55016003)(5660300002)(9686003)(2906002)(66476007)(478600001)(41300700001)(52536014)(76116006)(316002)(66556008)(54906003)(64756008)(66446008)(6916009)(66946007)(71200400001)(6506007)(7696005)(83380400001)(4326008)(8676002)(8936002)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iqIynDs6SfNsEemdhTp5lpBdB7QEWAZuzQyAza5JeNuinaVMzCaC7Pcwjq/x?= =?us-ascii?Q?R1n3qd6LDy1Tyqeyv4yNx1dX1KRqBXGKezkhDlM0eK6nT/qa25LA5kulsVze?= =?us-ascii?Q?TXh13SHyxSUOz4Yyv0YcM+hHPOxE/vf/aDU1TUrOEhFC461Bl0cAIAW8AFEQ?= =?us-ascii?Q?eUIcjXomvV3nJrzX9lfcjECXkAl/AOi3pciQq1rqc6dfeOJTUGI1u37VfDeC?= =?us-ascii?Q?2oZMh9UGHM/m1kl2faFDrfXz7xzOjCnuH5IPSub6WxaxV/8npo4nis7OW6GY?= =?us-ascii?Q?V+ZfsCkDviciFg1gPhl1AgoBAM9cI/XEZ1Q++hv3drCqcvDQw7VTwEaHrbkc?= =?us-ascii?Q?944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px9646N9VolaB9O0?= =?us-ascii?Q?QrksQ+4eBozS9cx3/YX5/Ru0P+OZv9eFLrfRjfMOI0KczhVA1ZQH0eu9wTbM?= =?us-ascii?Q?LAd1ojQSezMP630SZwYvLIiX+kV7E3Y/o1LU8GB3tne79JIXGwfv9UbzUz1N?= =?us-ascii?Q?DVnQUgeztYU9K+66NtT/Sry37RHF2GCyfUH0FN82+XipANDYpUymVMicyLdT?= =?us-ascii?Q?2eyjkZ2uxafbNUojNSqJ8sRnxDYOP9GAxebJRa4J8XcANKNJXmgesavC2c23?= =?us-ascii?Q?KnCjPXD6KsMicab2W3DraJd9L3/9s1xX3lkwzZDZGwKcc+LEB3+4Sj2yPrLi?= =?us-ascii?Q?EgvV73mRpdg1seplqV6CKvlWvF87L9RCZtvOpVLwxLonwFXG4RXDr3ej2jsY?= =?us-ascii?Q?xQ=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: 0e960588-da6f-49c4-223d-08dbbda4a89a X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2023 08:51:50.3483 (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: kpEsXIAkKc5IRRHTlA1XJUx22QsOHLz12Qtayum72/3LSb45QlCb4kXCh6ApMy6HzbaaKkGxvMWUbKH5C20LomJbR4u7T0pW1MxpbwHBhZM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10322 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 25 Sep 2023 01:52:13 -0700 (PDT) Hi Marc Zyngier, Thanks for the feedback. > Subject: Re: [PATCH 2/3] irqchip: renesas-rzg2l: Mask interrupts for > changing interrupt settings >=20 > On Mon, 18 Sep 2023 13:24:10 +0100, > Biju Das wrote: > > > > As per RZ/G2L hardware manual Rev.1.30 section 8.8.3 Precaution when > > changing interrupt settings, we need to mask the interrupts for any > > changes in below settings: > > > > * When changing the noise filter settings. > > * When switching the GPIO pins to IRQ or GPIOINT. > > * When changing the source of TINT. > > * When changing the interrupt detection method. > > > > This patch masks the interrupts when there is a change in the > > interrupt detection method and changing the source of TINT. > > > > 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 2cee5477be6b..33a22bafedcd 100644 > > --- a/drivers/irqchip/irq-renesas-rzg2l.c > > +++ b/drivers/irqchip/irq-renesas-rzg2l.c > > @@ -116,11 +116,13 @@ static void rzg2l_irqc_irq_disable(struct irq_dat= a > *d) > > u8 tssr_index =3D TSSR_INDEX(offset); > > u32 reg; > > > > + irq_chip_mask_parent(d); > > raw_spin_lock(&priv->lock); > > reg =3D readl_relaxed(priv->base + TSSR(tssr_index)); > > reg &=3D ~(TSSEL_MASK << TSSEL_SHIFT(tssr_offset)); > > writel_relaxed(reg, priv->base + TSSR(tssr_index)); > > raw_spin_unlock(&priv->lock); > > + irq_chip_unmask_parent(d); >=20 > What guarantees that the parent irqchip state has been correctly restored= ? > Nothing refcounts the nesting of mask/unmask. >=20 > > } > > irq_chip_disable_parent(d); >=20 > I'd rather you start by *disabling* the parent, and then none of that > matters at all. Agreed. Will do this in next version. >=20 > > } > > @@ -137,11 +139,13 @@ static void rzg2l_irqc_irq_enable(struct irq_data > *d) > > u8 tssr_index =3D TSSR_INDEX(offset); > > u32 reg; > > > > + irq_chip_mask_parent(d); > > raw_spin_lock(&priv->lock); > > 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)); > > raw_spin_unlock(&priv->lock); > > + irq_chip_unmask_parent(d); > > } > > irq_chip_enable_parent(d); >=20 > Same thing: if the parent was disabled, why do we need to do anything? OK. It is not required. >=20 >=20 > > } > > @@ -226,10 +230,12 @@ static int rzg2l_irqc_set_type(struct irq_data *d= , > unsigned int type) > > unsigned int hw_irq =3D irqd_to_hwirq(d); > > int ret =3D -EINVAL; > > > > + irq_chip_mask_parent(d); > > if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) > > ret =3D rzg2l_irq_set_type(d, type); > > else if (hw_irq >=3D IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) > > ret =3D rzg2l_tint_set_edge(d, type); > > + irq_chip_unmask_parent(d); >=20 > This one is the only interesting one: why don't you mask the interrupt at > the local level rather than on the parent? And this should be conditioned > on the interrupt state itself (enabled or disabled), not done > unconditionally. OK. Will do this locally by conditioned on the interrupt state. Cheers, Biju