From patchwork Mon Dec 5 18:25:16 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: 29850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2409502wrr; Mon, 5 Dec 2022 10:28:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf7MBHtZt0ia2jMYJqkW/xKt9bWY+jK0PD/OEWDygGKTOVcfzweC4JQu4JsthDDTKgigflDr X-Received: by 2002:a17:906:ca2:b0:7b9:eef3:4435 with SMTP id k2-20020a1709060ca200b007b9eef34435mr7877298ejh.696.1670264911519; Mon, 05 Dec 2022 10:28:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670264911; cv=none; d=google.com; s=arc-20160816; b=BWKrxCSD3adMR+CSoUOYd/4AwhZ778nKeZKPgn0TIjl7o3oyc6LAtMAK3glG3adpp8 k0RX6RC6Y7+orADHRIaRjk4I+EEacIfU5474dxL4F/L1WrfoYwVsTud8WTsdREclvU1i YnJZCsVqqSoQoSHxDVCO7Vnl51KDfCtH30aXQTT7x7mK4VfN9F1nGymt+wIY38PhI2BM j9VWBujWNfzcPYaCHf170eTszaFl1z+SBZn+oVa9rzunvK+nOrscrqHDYuT6DbludlWE 2vQ6KO1DOk4QsBUliw6J99E6QfNkwLju9HDoP7dfhDoLR0HisVbiyJc6R2YtEviRGpLE hLPA== 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=NHhj8qArRoE/GaCi87l68Q4zfw3Edt+BSTtfiTr/37I=; b=vXzHivAdntvquM+pLeaQXpyh35IjwROn2zkx728Iu5+vBQFMBaXAGqscNtQ0VE0f0v Ky2+aqmleMKbLmAiOPraTcps0vrfPedi9D+m9N1scu+QXaITKVprSGNy2GYcaPxwPlYS W3koJACC3t3iL0M3PrJV3vKb9af/KsJj3F6/Xd+wGrn2UYv95v3evKi6hwpoKXFIE899 1CUg0uXnK0P/TQOGJcUArWKPOA/J9q9SYoiG0L8KjugxQxWb4dWpTLP4QNceUA+wES/k n5RS0qfGwiSfNOBINMUi6Z1VIOmeKmgFEW9Eqv/zWL/r6akyeTiBQlABmQqfPohvzU8F BkJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=224ItIum; 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 e4-20020a17090658c400b0078e27f2ef4bsi12739749ejs.956.2022.12.05.10.28.08; Mon, 05 Dec 2022 10:28:31 -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=224ItIum; 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 S232492AbiLES12 (ORCPT + 99 others); Mon, 5 Dec 2022 13:27:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232499AbiLESZU (ORCPT ); Mon, 5 Dec 2022 13:25:20 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762A0209A2; Mon, 5 Dec 2022 10:25:18 -0800 (PST) Date: Mon, 05 Dec 2022 18:25:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1670264717; 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=NHhj8qArRoE/GaCi87l68Q4zfw3Edt+BSTtfiTr/37I=; b=224ItIum4v5/1uWWHliNLW0BsOAcsnugLO06YdJliHzza5I+LVm3txORiBxsQyehMZxaJs X+pO7Dc6wN/q5fQBE63vHnR63EBlaGedFc1AGuvhEdqAlPUquilvsKqpYQluE0R8x8/J8X 4CCi4pOT+f0cgCNoq07YbSkpQsqr1vANrM1JsY48lvaM7ZNKe9VVItU3KCstONYneJSFvh 04r0bGn59WOp2tG/h3sdMLIT24QhuWJSD7irGX1G3w01VPC8BOZfwDon/PfQkq9NAd6kvJ 8ErEXZkqwdCp1FwcHdZ8KaNuzgRZHPHDrodzszbyH9Njscvq6DbNCagD5DeqMQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1670264717; 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=NHhj8qArRoE/GaCi87l68Q4zfw3Edt+BSTtfiTr/37I=; b=4QPIAX9wduFPBOFgPqVFiYzh8iIhYquLhayycvQ30DGWVdHHZEhjdxX1DE3bNsCS8TJbrs VqRA82E9vJEicWBw== From: "tip-bot2 for Thomas Gleixner" 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: Provide data structs for per device domains Cc: Thomas Gleixner , Kevin Tian , Marc Zyngier , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221124232325.442499757@linutronix.de> References: <20221124232325.442499757@linutronix.de> MIME-Version: 1.0 Message-ID: <167026471676.4906.14029318671604815488.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?1750422138572383567?= X-GMAIL-MSGID: =?utf-8?q?1751399700224308031?= The following commit has been merged into the irq/core branch of tip: Commit-ID: ebca4396ee18521e9e5d435a15e5d0ab2eb6b009 Gitweb: https://git.kernel.org/tip/ebca4396ee18521e9e5d435a15e5d0ab2eb6b009 Author: Thomas Gleixner AuthorDate: Fri, 25 Nov 2022 00:25:49 +01:00 Committer: Thomas Gleixner CommitterDate: Mon, 05 Dec 2022 19:21:01 +01:00 genirq/msi: Provide data structs for per device domains Provide struct msi_domain_template which contains a bundle of struct irq_chip, struct msi_domain_ops and struct msi_domain_info and a name field. This template is used by MSI device domain implementations to provide the domain specific functionality, feature bits etc. When a MSI domain is created the template is duplicated in the core code so that it can be modified per instance. That means templates can be marked const at the MSI device domain code. The template is a bundle to avoid several allocations and duplications of the involved structures. The name field is used to construct the final domain and chip name via: $PREFIX$NAME-$DEVNAME where prefix is the optional prefix of the MSI parent domain, $NAME is the provided name in template::chip and the device name so that the domain is properly identified. On x86 this results for PCI/MSI in: PCI-MSI-0000:3d:00.1 or IR-PCI-MSIX-0000:3d:00.1 depending on the domain type and the availability of remapping. Signed-off-by: Thomas Gleixner Reviewed-by: Kevin Tian Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20221124232325.442499757@linutronix.de --- include/linux/msi.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/include/linux/msi.h b/include/linux/msi.h index 9bf3cba..7fb8737 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -74,7 +75,6 @@ struct msi_msg { extern int pci_msi_ignore_mask; /* Helper functions */ -struct irq_data; struct msi_desc; struct pci_dev; struct platform_msi_priv_data; @@ -442,6 +442,20 @@ struct msi_domain_info { void *data; }; +/** + * struct msi_domain_template - Template for MSI device domains + * @name: Storage for the resulting name. Filled in by the core. + * @chip: Interrupt chip for this domain + * @ops: MSI domain ops + * @info: MSI domain info data + */ +struct msi_domain_template { + char name[48]; + struct irq_chip chip; + struct msi_domain_ops ops; + struct msi_domain_info info; +}; + /* * Flags for msi_domain_info *