From patchwork Mon Nov 21 14:37:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 23815 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1627700wrr; Mon, 21 Nov 2022 06:39:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf7MX1DBYHpb0LrBBTJ/YOIklpbW18S7BGMbOrzgGgqPfKkdfAXkXgIh0gmv6EUx+W7OR6Qn X-Received: by 2002:a17:903:44f:b0:187:3a43:3a9d with SMTP id iw15-20020a170903044f00b001873a433a9dmr11924065plb.152.1669041599042; Mon, 21 Nov 2022 06:39:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669041599; cv=none; d=google.com; s=arc-20160816; b=cIi+BKekLLPFmrwKPEQ6XWQ70Uj6ks3Q1Eiw9xI6Dle/pxGJsH2MRxLZFuhv1qAIol vVTENVfprjhsdoQK0SmCC9q6XMCbvvttJaHNrtbbQvWzTIrxCu3fd7WbOZvRH/0Pa3ro 8GMpjMG3PlOY2jQveMBki8LlG4BsTUz77x/Q3u0WEo7n40gjy26hunZ9I/tj22Ebf1yX xl4UdBjwVFmsUZwvFpp1LLEuga5Y4rmR+1DzCJucG7z3z8k4/iM2iDRUsdFM/IOTNJuO iIgmF37KyIh4JQ06fuaL283lNM8Qz9k7vPFmzvFbjkNviX0M9Ubo8C++6/oQH4K0Fjrl 2SjQ== 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=MZ8jPM+DGKOpETlDvAHwxuzbjfVqWBMalr44KdANGx8=; b=xSephLJ1C52QPYrQ5QV+1XqTwfv+I6PtItaocgBU3aRMewcKkLooekmACujRE1dLAj nnTcSTigMs0QA8ob0c7ktbviHTEbbJ9/i4zA7kP2KG8ahBpqdPM+thZAnJ9TSCbSOJ7n BIbhX/jnGmGKa7qzshh2id/qFkccnFUlGr/G27RzOtwmufApdHTPRFtiRrhSKaufgClt izn0zv0C1MiWWkm7Pbrnr0CiVajaEFSVg1yonLhnNKHfjfC1ieiPBitE7VswmRfwphTt rX56Qk25+kwr5Tc++Puyrp2xDdEDwlEUxK7IkFVME7FWt2uuU8W49/m/ExdJKjS7Cbl4 op5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=jVyiurSF; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=CReccuOn; 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 nn10-20020a17090b38ca00b00214021e87d1si15990266pjb.173.2022.11.21.06.39.44; Mon, 21 Nov 2022 06:39: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=@linutronix.de header.s=2020 header.b=jVyiurSF; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=CReccuOn; 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 S230345AbiKUOjQ (ORCPT + 99 others); Mon, 21 Nov 2022 09:39:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231622AbiKUOhy (ORCPT ); Mon, 21 Nov 2022 09:37:54 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2707A77217; Mon, 21 Nov 2022 06:37:54 -0800 (PST) Message-ID: <20221121091326.769133826@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669041472; 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=MZ8jPM+DGKOpETlDvAHwxuzbjfVqWBMalr44KdANGx8=; b=jVyiurSFqZAUGWno02f2IPodi3QwmpcrP1Vp2Ks0TgbJO20F/dWxDsa5dkEbr6Pg7p97Zy rPp/3DeHMD3AmuIy1U6tnu38EVMxnDmSZ5WOK1XOEDm5yDz8fIPDe/LG0uIWDMtpu8iBS4 vqdD0gGHsMTBRzfa1ctvixmDkcjkyFrvKI/cphmfB0/vKb9d53rQDJavu1Sin8HXPtqfTl 7Fwh7u9cjesrfJL67x+o31/16McsURPTx7cl1gWZUfgzl8L4mUWxY8aO6fCEOb99PrmRqm jNat6FOPDzEVcjez0lrzaaeC2yqPDyEPR3Rh21W979eeXF67X5U6AgaAagyjJw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669041472; 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=MZ8jPM+DGKOpETlDvAHwxuzbjfVqWBMalr44KdANGx8=; b=CReccuOnPb82wr5d0rcYob2PGyVgUsEM1kQ3zSl0zyf8wPkw1ry+mxpKf5xLJwlBnkTmpS 2Dcw+yPVAXZHm0Bw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe Subject: [patch V2 05/33] genirq/msi: Split msi_create_irq_domain() References: <20221121083657.157152924@linutronix.de> MIME-Version: 1.0 Date: Mon, 21 Nov 2022 15:37:52 +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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750116963890182040?= X-GMAIL-MSGID: =?utf-8?q?1750116963890182040?= Split the functionality of msi_create_irq_domain() so it can be reused for creating per device irq domains. No functional change. Signed-off-by: Thomas Gleixner --- kernel/irq/msi.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -796,17 +796,10 @@ static void msi_domain_update_chip_ops(s chip->irq_set_affinity = msi_domain_set_affinity; } -/** - * msi_create_irq_domain - Create an MSI interrupt domain - * @fwnode: Optional fwnode of the interrupt controller - * @info: MSI domain info - * @parent: Parent irq domain - * - * Return: pointer to the created &struct irq_domain or %NULL on failure - */ -struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode, - struct msi_domain_info *info, - struct irq_domain *parent) +static struct irq_domain *__msi_create_irq_domain(struct fwnode_handle *fwnode, + struct msi_domain_info *info, + unsigned int flags, + struct irq_domain *parent) { struct irq_domain *domain; @@ -814,7 +807,7 @@ struct irq_domain *msi_create_irq_domain if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS) msi_domain_update_chip_ops(info); - domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0, + domain = irq_domain_create_hierarchy(parent, flags | IRQ_DOMAIN_FLAG_MSI, 0, fwnode, &msi_domain_ops, info); if (domain) { @@ -827,6 +820,21 @@ struct irq_domain *msi_create_irq_domain } /** + * msi_create_irq_domain - Create an MSI interrupt domain + * @fwnode: Optional fwnode of the interrupt controller + * @info: MSI domain info + * @parent: Parent irq domain + * + * Return: pointer to the created &struct irq_domain or %NULL on failure + */ +struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode, + struct msi_domain_info *info, + struct irq_domain *parent) +{ + return __msi_create_irq_domain(fwnode, info, 0, parent); +} + +/** * msi_parent_init_dev_msi_info - Delegate initialization of device MSI info down * in the domain hierarchy * @dev: The device for which the domain should be created