From patchwork Thu Nov 17 15:08:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 21731 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp453533wrr; Thu, 17 Nov 2022 07:12:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf7KpTH1HXAR+HBDLdtH6Iz8Qj/w/Mj0gIcK0CiB8S+z9+lL0AJlCpkmo0hmk4HHFFFkRGfF X-Received: by 2002:a17:906:b78a:b0:7ad:ab0e:76aa with SMTP id dt10-20020a170906b78a00b007adab0e76aamr2434001ejb.435.1668697926343; Thu, 17 Nov 2022 07:12:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668697926; cv=none; d=google.com; s=arc-20160816; b=f961vKJmgUZa0CcBIkNbjYuzlLgfl6XstIKS9+kvDI3Wust4vLanAMZxlOV4Izboh4 AdAwKGZzvCAqnSJ1+B+Ly989ekPFlSGC99YmoFxnwyWvkd3SF5INtP7LSiML1Z41iTfK 7EnrTD3y4ePOP53YZ/AEkJAQKif8fjk2puceXLHPC28jFIGpGTLUI4QLpNbkzWI91Eqm VtWkxAQrZ1MBKdn8W0CDlzaE4Roz/GxiMQFj2cj6HFypnQSKiO4Y5SFO/872wgy6yea2 PYQzRJkdf48trZz74CDIZkKq8Bwf7gK8tJ0fRLCsdr1lRfWvF9O0D4NzhnuibySTQu4t lYTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=4S6xFRuOywIYX/+zBaY5VavIV99OHhyBsrjYOQXPfns=; b=Oq1EDLjTE3UikRBGaN8Bxw3nZuzKdRw4Juy/ram3ozr4HU+4vI1qXOEv+JbaJnhNSw QD6RJIJMkmAyIFwxb3eYCw1dI5bHVhu1BncxbtU6BlUfWarBsHm520XO6A9O3x7maSv6 NxQLATVSJMZJuFXElWDWDX1VChnLNGLAp6W5FoAhV4ytFhmKg0M6KEmq9Wcd3zoSEFlb aeRW096I/bgcdvEtYBA60c+eZD2A/aAr3/Sa2rDKLelNZLXpAa8SkxMNfFQ57e7Ol6ed vmTcIfkkLnKJyYxjWjlg7cj2duyxc20FZg3iYIBbuUOyIFnbuI5gsWdWLUxNyRjXk6Qq WzfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=c5mLPeXP; dkim=neutral (no key) header.i=@linutronix.de; 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 ga4-20020a1709070c0400b007ade20fc40csi928824ejc.810.2022.11.17.07.11.39; Thu, 17 Nov 2022 07:12:06 -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=c5mLPeXP; dkim=neutral (no key) header.i=@linutronix.de; 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 S240613AbiKQPK5 (ORCPT + 99 others); Thu, 17 Nov 2022 10:10:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240458AbiKQPJ1 (ORCPT ); Thu, 17 Nov 2022 10:09:27 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6803D781B9; Thu, 17 Nov 2022 07:08:23 -0800 (PST) Date: Thu, 17 Nov 2022 15:08:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668697702; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4S6xFRuOywIYX/+zBaY5VavIV99OHhyBsrjYOQXPfns=; b=c5mLPeXPVhWRN43HFHwkKfbKxqglmNPh8BliQ1LOt747Dn4j/ObGkTH1FV/3M87yiekQ/X 3HZOuGLU9OPVpkFvUSz1tbEZ3iQCLjJjgvWMve2bmRRnJDF1PnSxxGVZzuVHR6sp1i6tFY KxahdlKWNImkdCBPkBvCe00F78uG1D3oBq1QUJuCZ6mIQqiPoCHSvxZ3sXI75b9aTrFccx RQW5xeGHCx9nG1JtugeEQqa4BF01urQHhRmEpD2Nnrqc4YddpUsH8kqqNSlP243pYZhs+4 TCmTNF8sLIZ68XVtl2oo7VNr/akxSX9TZubO+WDIAY2SWWojIyUa175HNkeDiQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668697702; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4S6xFRuOywIYX/+zBaY5VavIV99OHhyBsrjYOQXPfns=; b=2LdQxk06VzLDsKk8xDgMWHbgUf7Tem2OUwpJUy96ntQUZwiOHF2r6atDuGEa+ZWD0vpqzK vccfFwaJYPX0UzBQ== From: "tip-bot2 for Ahmed S. Darwish" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] genirq/msi: Add bus token to struct msi_domain_info Cc: Thomas Gleixner , "Ahmed S. Darwish" , Jason Gunthorpe , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20221111122014.294554462@linutronix.de> References: <20221111122014.294554462@linutronix.de> MIME-Version: 1.0 Message-ID: <166869770083.4906.6897829331118703189.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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?1749208290717554140?= X-GMAIL-MSGID: =?utf-8?q?1749756596822484230?= The following commit has been merged into the irq/core branch of tip: Commit-ID: 22db089a4437a72277677f99717af499560b13f2 Gitweb: https://git.kernel.org/tip/22db089a4437a72277677f99717af499560b13f2 Author: Ahmed S. Darwish AuthorDate: Fri, 11 Nov 2022 14:54:33 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 17 Nov 2022 15:15:19 +01:00 genirq/msi: Add bus token to struct msi_domain_info Add a bus token member to struct msi_domain_info and let msi_create_irq_domain() set the bus token. That allows to remove the bus token updates at the call sites. Suggested-by: Thomas Gleixner Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20221111122014.294554462@linutronix.de --- include/linux/msi.h | 19 +++++++++++-------- kernel/irq/msi.c | 7 +++++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/linux/msi.h b/include/linux/msi.h index ee735ff..2dfd7b2 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -16,6 +16,7 @@ * abuse. The only function which is relevant for drivers is msi_get_virq(). */ +#include #include #include #include @@ -365,6 +366,7 @@ struct msi_domain_ops { /** * struct msi_domain_info - MSI interrupt domain data * @flags: Flags to decribe features and capabilities + * @bus_token: The domain bus token * @ops: The callback data structure * @chip: Optional: associated interrupt chip * @chip_data: Optional: associated interrupt chip data @@ -374,14 +376,15 @@ struct msi_domain_ops { * @data: Optional: domain specific data */ struct msi_domain_info { - u32 flags; - struct msi_domain_ops *ops; - struct irq_chip *chip; - void *chip_data; - irq_flow_handler_t handler; - void *handler_data; - const char *handler_name; - void *data; + u32 flags; + enum irq_domain_bus_token bus_token; + struct msi_domain_ops *ops; + struct irq_chip *chip; + void *chip_data; + irq_flow_handler_t handler; + void *handler_data; + const char *handler_name; + void *data; }; /* Flags for msi_domain_info */ diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index a2efa00..b46b747 100644 --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -694,8 +694,11 @@ struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode, domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0, fwnode, &msi_domain_ops, info); - if (domain && !domain->name && info->chip) - domain->name = info->chip->name; + if (domain) { + if (!domain->name && info->chip) + domain->name = info->chip->name; + irq_domain_update_bus_token(domain, info->bus_token); + } return domain; }