From patchwork Fri Nov 11 13:58:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 18820 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp758888wru; Fri, 11 Nov 2022 06:06:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf7kPoF6vv0uM5Hcxj33RMYU/UbWdAk5SdbbHsnrrhTpapEE3gLj6DSSck2ao+Vmf1alNdIj X-Received: by 2002:a17:90a:4503:b0:200:2069:7702 with SMTP id u3-20020a17090a450300b0020020697702mr2067601pjg.239.1668175600999; Fri, 11 Nov 2022 06:06:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175600; cv=none; d=google.com; s=arc-20160816; b=lL3lxKHkA8n/M5C+cJyYSm9tZ8xhliLlpnJnOF4tDpO9jNl+0ro+8rfIO1sU0rwebL 3a5k9AV9AW30Zclti7SzhbZIJ2RNcAt5o7Hec6ZxvaG8kXI/4r2hUvHQRLtq5equlS2e GClZspWyI1sgpCAw2x+s/Zf8RHHb9qD1VdUrKgSZ8Y7j/aeZXnjWf3f5VZiV6pEcNE/r gKxRzVCZaEdkWII9h0ftY3YnrHO3JxcWFwW3STVaip2/UotA3YwXt53rVNbMMe9LbkCu QTYbD+yLRqT6x5y6hnQxvZsuadoQhmYNGR+9a3MJtsjVazJiRw2xd4pyNDUQ7HGU64Xg 0UKg== 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=/GP5ZfhesXV4jkE3W+IUGaBn9TdtWzm6Yg+gBfFIDQM=; b=Hyuyco54ofJciiHkaFXrhDkzr05rq3SCASfVooyI1qkCMFV2agB8N5eZN9uoZ+EiTn 3tetm591IY5BzS5vhUUWM/M1CAKJhmrYqzZLZtxXTH2AJ3+KnliBc3nytEEah2ZS9mii 6EAWcT0fFUiU2RDobfH7gI9ZmmrV56gbH+2CTQpxYEDS7qlM11apg4DFr2jCDsNw4mGc 7ZjzICH6GU1yFIA106Gc2mpYEWLRsCeAtW9YTBF4hi7HthRX5xC3ewCBZf+82eTP8JbN ctey1K5FnVu75Rw9xFdg0ckygj7ZysuP/7VzgrWUq7lkuaZeN1kmO0VdvbGwRtkp3MIZ aT5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=T9GnH5Wx; 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 q21-20020a170902789500b00178276c2e35si2394943pll.38.2022.11.11.06.06.26; Fri, 11 Nov 2022 06:06:40 -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=T9GnH5Wx; 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 S234231AbiKKOFG (ORCPT + 99 others); Fri, 11 Nov 2022 09:05:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234024AbiKKOEo (ORCPT ); Fri, 11 Nov 2022 09:04:44 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA6BF86D7D; Fri, 11 Nov 2022 05:58:53 -0800 (PST) Message-ID: <20221111135205.427665748@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668175096; 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=/GP5ZfhesXV4jkE3W+IUGaBn9TdtWzm6Yg+gBfFIDQM=; b=T9GnH5Wxg6y5adVcI9HYbFSasOntQpqN7EM4Ju8aS+Hp62qxyuj5npMIuVBzZ1HCgw6JES XYLaSo+SsgO4NZ3gfROtO2WFKm1reRAzZ/bd0NNkrOcvlMYWCfNJFg5thHN+zzfLWKGzfD uxY4HOhHU7INrUHvN4pZpoHvJ2uuEm1he0Z310uRoHCLV4qSs7uniTK4hWNZHmIgch0bzv iYiaZ+6ttdVqK8+CTQVnzMpEpASenL8b5oN8mRDUKoFc/XVfQD/tQihxP0K1vTonGxKRx3 fMtUQ5z8qAj+mSGwKGX9mP1oQYspNs+Ro3CBlyZqvRrfDshKUR1rdD7+2iEKhg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668175096; 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=/GP5ZfhesXV4jkE3W+IUGaBn9TdtWzm6Yg+gBfFIDQM=; b=QjNe8fnlTswrfFOfkjUSFhg8xeO8gQDG/CNErx383a8OQ6oKUGU0syWSQs7LYOCdcl6LJI dr5oNw7EczlrTSDw== 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 , "Ahmed S. Darwish" , Reinette Chatre Subject: [patch 03/33] genirq/msi: Provide data structs for per device domains References: <20221111133158.196269823@linutronix.de> MIME-Version: 1.0 Date: Fri, 11 Nov 2022 14:58:15 +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?1749208899116489683?= X-GMAIL-MSGID: =?utf-8?q?1749208899116489683?= 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 --- include/linux/msi.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) --- 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; @@ -430,6 +430,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 *