Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8905017rwb; Thu, 24 Nov 2022 05:49:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf7AhPQiwPZYSoTrN+LSnz5UGHBvJlRq7xkkPisNb+lLiKri/b3pIc2cklzRGsdaxCHVg7Ae X-Received: by 2002:a17:90a:3f89:b0:217:90e0:3f8c with SMTP id m9-20020a17090a3f8900b0021790e03f8cmr41559114pjc.192.1669297799108; Thu, 24 Nov 2022 05:49:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669297799; cv=none; d=google.com; s=arc-20160816; b=I4PEGprQz8X+n61UOVXJlCL1G/uZvjdHCbDD7klfrmWh/1zBVxE3aRcj/SwrnbcAAt S7+T9FQhavjogzDpVtAYVETTZhawG4LUNUI6EI/7e6nBgQ86gFMWM8EgOR2BpNadLSZT hdN5/gs1kzuiHLyBXwwS+SSWTG9rRqOKvHvQEj5gJ3Npj2+Tt2YtnwWDUst4gFE3Esot /ElS4NIKnG+hu+1/gGZYtGEby4n6/A+j05A+K5Yg5U6h9lZ5yamMzvmmM9x3KA0fLyDV D048wQhuSh4g6PD7c8WZQc9ZJ+EN1LtexwrXktQMRV5PRqj9vyq5A4pOm5Oeyi8xyPkr /GSQ== 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=v76fgyR6S0g+7yrzatAARF1a45o0IvL4z0oW+nwkTWY=; b=J3UwcNd9xp/Vrwe6Z4zMY/AFuLrX8hP7cwYPAPTleEXGPYl28d++N4LrtrPMKOyvkc oirrbceTfrUxalxe9QovTlvgDfkMPTpuc3LqZwLgRssxs8S65GKQihe8Nqx8xq9sLoc9 4jUaWB9LTdLwIe1f352N86Z6cMc/KK2SKHekefNqfn7YhaymfN3vWfRg8L5s9mytd20z BUcgdpxezvBk8R/5LDhHdfEUZgKN93Q1lvReIPvkgIC+ztbBLP+4t+vY0i7PejqQlije A2Oem5+V4janVaMgvfYiwbgF3wKxq7zNW0yAxdGq7Ada9SWupLSrXJGO5oTc+chGDTWs LbnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dw9Qt14P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d14-20020a63a70e000000b00457f4e8e21esi1353266pgf.731.2022.11.24.05.49.47; Thu, 24 Nov 2022 05:49:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dw9Qt14P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbiKXNi7 (ORCPT + 86 others); Thu, 24 Nov 2022 08:38:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229883AbiKXNi6 (ORCPT ); Thu, 24 Nov 2022 08:38:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2E0BF2C3F; Thu, 24 Nov 2022 05:38:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5F58762127; Thu, 24 Nov 2022 13:38:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC49AC433D6; Thu, 24 Nov 2022 13:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669297136; bh=7Au/HDQUhNqjxPT9EIdVuLBQ7xa+X0OeJzBexjpcgvM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dw9Qt14PDNMG2cdC0+PZTRsjYtl/WNvN7HhmltKxOZH1F06zFPNy2R6vPPL2vZnRP fbu9KbF8aBm/uu87+jWfPdJkCg+BQQ0k5E7NG+1yJJZwK7BDRh0k3aRXFJ3/N2YNOy 6DF3KXDeKm3C37I+0+R5r0DJGKr7jdO4Zyow4HpE6qvpq7JEfF0yiU4tIP6EQ7SoPW Pb7LjYV7EiSj1lgsxnexhXBQomC8IfeNUUFy0LHR4RVLrmqU1hReNPYCpqfLgocZdj Lr40RA/zlu5rwkacsmJw3pihB3Esop5PZ41PLMIcfMMwLWv8ZEv/4BRAB/jAhkxfki 8JFJJMoC0nwSA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1oyCRK-008Ntt-J2; Thu, 24 Nov 2022 13:38:54 +0000 Date: Thu, 24 Nov 2022 13:38:54 +0000 Message-ID: <86zgcgmpzl.wl-maz@kernel.org> From: Marc Zyngier To: Thomas Gleixner Cc: LKML , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Greg Kroah-Hartman , Jason Gunthorpe , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Ammar Faizi , Robin Murphy , Lorenzo Pieralisi , Nishanth Menon , Tero Kristo , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, Vinod Koul , Sinan Kaya , Andy Gross , Bjorn Andersson , Mark Rutland , Shameerali Kolothum Thodi , Zenghui Yu , Shawn Guo , Sascha Hauer , Fabio Estevam Subject: Re: [patch V2 06/40] PCI/MSI: Provide static key for parent mask/unmask In-Reply-To: <87bkowcx0z.ffs@tglx> References: <20221121135653.208611233@linutronix.de> <20221121140048.659849460@linutronix.de> <8635a8o65q.wl-maz@kernel.org> <87bkowcx0z.ffs@tglx> 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/27.1 (aarch64-unknown-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: 185.219.108.64 X-SA-Exim-Rcpt-To: tglx@linutronix.de, linux-kernel@vger.kernel.org, will@kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, lorenzo.pieralisi@arm.com, gregkh@linuxfoundation.org, jgg@mellanox.com, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, ammarfaizi2@gnuweeb.org, robin.murphy@arm.com, lpieralisi@kernel.org, nm@ti.com, kristo@kernel.org, ssantosh@kernel.org, linux-arm-kernel@lists.infradead.org, vkoul@kernel.org, okaya@kernel.org, agross@kernel.org, andersson@kernel.org, mark.rutland@arm.com, shameerali.kolothum.thodi@huawei.com, yuzenghui@huawei.com, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com 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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 On Thu, 24 Nov 2022 13:17:00 +0000, Thomas Gleixner wrote: > > On Thu, Nov 24 2022 at 13:04, Marc Zyngier wrote: > > On Mon, 21 Nov 2022 14:39:36 +0000, > >> static void pci_mask_msi(struct irq_data *data) > >> { > >> struct msi_desc *desc = irq_data_get_msi_desc(data); > >> > >> pci_msi_mask(desc, BIT(data->irq - desc->irq)); > >> + cond_mask_parent(data); > > > > I find this a bit odd. If anything, I'd rather drop the masking at the > > PCI level and keep it local to the interrupt controller, because this > > is likely to be more universal than the equivalent PCI operation > > (think multi-MSI, for example, which cannot masks individual MSIs). > > > > Another thing is that the static key is a global state. Nothing says > > that masking one way or the other is a universal thing, specially when > > you have multiple interrupt controllers dealing with MSIs in different > > ways. For example, GICv3 can use both the ITS and the GICv3-MBI frame > > at the same time for different PCI RC. OK, they happen to deal with > > MSIs in the same way, but you hopefully get my point. > > I'm fine with dropping that. I did this because basically all of the > various ARM PCI/MSI domain implementation have a copy of the same > functions. Some of them have pointlessly the wrong order because copy & > pasta is so wonderful.... > > So the alternative solution is to provide _ONE_ set of correct callbacks > and let the domain initialization code override the irq chip callbacks > of the default PCI/MSI template. If the various irqchips can tell the core code whether they want things to be masked at the PCI level or at the irqchip level, this would be a move in the right direction. For the GIC, I'd definitely want things masked locally. What I'd like to get rid off is the double masking, as I agree it is on the "pretty dumb" side of things. Thanks, M. -- Without deviation from the norm, progress is not possible.