[V2,07/40] irqchip/gic-v3: Make gic_irq_domain_select() robust for zero parameter count
Message ID | 20221121140048.722992910@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1640582wrr; Mon, 21 Nov 2022 07:03:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf7VAdTJy3JRdUqScNLUhNRw2XKw82YPLCpGKwhBL6YkT7XhJsvSSmN3mKXzhySOUjggjAJ/ X-Received: by 2002:a17:906:3ac1:b0:78d:36d8:1814 with SMTP id z1-20020a1709063ac100b0078d36d81814mr15363320ejd.99.1669043028861; Mon, 21 Nov 2022 07:03:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669043028; cv=none; d=google.com; s=arc-20160816; b=QfdsESQ7Lmlo5w+QGHdyHZ9cu5KA84h45hSrS2+7pEC+ulvMI6hnUpIDqjk4qHIPlp nbVyGdtdUP5cn4k4h9X1mHmhU/DBj7o4uzzayzISToAgw1STRwoybbOdCJIqFdxBHaWC 9cVMxEesPGny5RapTS0ckuVinNcJU2eo2hBc9g8q4/SMu2uKBaUcGGm2VRPpHwEk94EL srPrpBjKKMhHXBeB2k717i5GYvSeYQRnzk+cvvTiurtVYrvyb25aio73W3jQ1WEYclPo 3VZl06cywZ4ayRtWGQQGijA1XJG18vMB6uxvNuaX9WA6m2qKna3iUegdb2garEwUt6Gs 3JZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=0uPKQvIE6eHWFWTzh0P31YZRE+J5P6MvaWi2wIg9qig=; b=WaYL8MePgvtdUqi3iuCSlS5QJaqVeTnomGZbbLu/a2jkzpD5C57u6KnqiFBSjkeUzz NVQl7MwBhqd3kjpNKpij1Tx8YeExbpiDE1pFqtS9D2L3Ht8wdadtKdfUVQQYPv9dZjaY rv608AlV5EPi4530sYi+cLK1mAAhqKD95TR6Cx2qNDoPeIa3iRJNThIHZcpf0C+z5MNX 8TJjavbpG66gON845Jsj+WzJFUtLRfnufZZAkAlfyfhBjib3Io9qsyF1WJ309rAtHzMI dP3EZKium9BURhXa1t+LE+vLoy6IvKygZE8rHMmzUPrGWR3rV+NcRy6R/9XKGPZUaja+ ULMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2xxh3n8f; dkim=neutral (no key) header.i=@linutronix.de header.b=PCeo9bxF; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp8-20020a1709071b0800b007add405cccdsi10292368ejc.444.2022.11.21.07.03.05; Mon, 21 Nov 2022 07:03:48 -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=@linutronix.de header.s=2020 header.b=2xxh3n8f; dkim=neutral (no key) header.i=@linutronix.de header.b=PCeo9bxF; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230377AbiKUOsj (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Mon, 21 Nov 2022 09:48:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231856AbiKUOqc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 21 Nov 2022 09:46:32 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F368D236B; Mon, 21 Nov 2022 06:40:56 -0800 (PST) Message-ID: <20221121140048.722992910@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669041577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=0uPKQvIE6eHWFWTzh0P31YZRE+J5P6MvaWi2wIg9qig=; b=2xxh3n8fCQKY1tupSQrL9RMghm2CJAVDhvY/Tjdbm5UyTrZ3617loyNvTvtgNhd1HURZCG Ex96BmehgLludH3jYNj5aEgGOs3VtfcvigHKrZKPcj+QOILkhwD1zWcorhR2EQI6SmQQ5n KukieQVmKgYlUtVMunHXe/xRbloR1Epl9yYeoaU26IAVI2n/oqnJCsqZfEUyIs0/ujwyPo pZrNPN0L6CDAvMrk6b/buOWEbQOjlyfd5MmgRoRi1qpQ16QV8lOeNG/friBcWTlSuxbbJC Hopj84F9VxpGLUoQSU3abw9iD9Rfjr2mF19toJL/p/AnaCzwIr5dX5AihkVlXg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669041577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=0uPKQvIE6eHWFWTzh0P31YZRE+J5P6MvaWi2wIg9qig=; b=PCeo9bxFppNV9qQQ6klCeD7Y79K1FfbS6EFwmhDWSSkQCY8I3v39UhssGnoodq7GVDpqqE ZkeJvgcIGuShZNDQ== From: Thomas Gleixner <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: Will Deacon <will@kernel.org>, linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Marc Zyngier <maz@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jason Gunthorpe <jgg@mellanox.com>, Andrew Lunn <andrew@lunn.ch>, Gregory Clement <gregory.clement@bootlin.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Ammar Faizi <ammarfaizi2@gnuweeb.org>, Robin Murphy <robin.murphy@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Nishanth Menon <nm@ti.com>, Tero Kristo <kristo@kernel.org>, Santosh Shilimkar <ssantosh@kernel.org>, linux-arm-kernel@lists.infradead.org, Vinod Koul <vkoul@kernel.org>, Sinan Kaya <okaya@kernel.org>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>, Zenghui Yu <yuzenghui@huawei.com>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Fabio Estevam <festevam@gmail.com> Subject: [patch V2 07/40] irqchip/gic-v3: Make gic_irq_domain_select() robust for zero parameter count References: <20221121135653.208611233@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Mon, 21 Nov 2022 15:39:37 +0100 (CET) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750118462826710228?= X-GMAIL-MSGID: =?utf-8?q?1750118462826710228?= |
Series |
genirq, irqchip: Convert ARM MSI handling to per device MSI domains
|
|
Commit Message
Thomas Gleixner
Nov. 21, 2022, 2:39 p.m. UTC
Currently the irqdomain select callback is only invoked when the parameter
count of the fwspec arguments is not zero. That makes sense because then
the match is on the firmware node and eventually on the bus_token, which is
already handled in the core code.
The upcoming support for per device MSI domains requires to do real bus
token specific checks in the MSI parent domains with a zero parameter
count.
Make the gic-v3 select() callback handle that case.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <maz@kernel.org>
---
drivers/irqchip/irq-gic-v3.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1613,9 +1613,13 @@ static int gic_irq_domain_select(struct irq_hw_number_t hwirq; /* Not for us */ - if (fwspec->fwnode != d->fwnode) + if (fwspec->fwnode != d->fwnode) return 0; + /* Handle pure domain searches */ + if (!fwspec->param_count) + return d->bus_token == bus_token; + /* If this is not DT, then we have a single domain */ if (!is_of_node(fwspec->fwnode)) return 1;