Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2211632rwb; Fri, 11 Nov 2022 06:34:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf5xsJvK9lQCO+DFYdTJhM2ZxWWF7zaYzQHEyewuKCLWP7QvtGrpQ9uUUDCvaRhDe2x2Zc1q X-Received: by 2002:a63:5c0a:0:b0:470:1186:de85 with SMTP id q10-20020a635c0a000000b004701186de85mr1823100pgb.609.1668177284673; Fri, 11 Nov 2022 06:34:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668177284; cv=none; d=google.com; s=arc-20160816; b=hpwljPUaYzt4An+cM2w07VQriBqKU1t3ZASFieq/SoI7CJxZnYNjEnOmrKcIRM5V+x ReTZ9CkCsn7pWObFt1F0kuZpG6xTUE9yaHPvMq7FsW7GjV7TwTIchjrIcgDMeCa3koEO Zcjc6rljlYTzmhwqgloQxsdwOPQ6JS4drtB4CHhyP8gw2skfWH3JZMLpDCyv/KUAZO3s zO3XzVGtqq9aucele+Lsw02BhoxkXKlwR3WRocJQSws3yQOMcymv11Gq/EMvhK1IGS+P LrXbJYJXJMZtoQXi9hBSYzq+0PVm3UytGUw6TNb3z2P4FNIZgDnyICO0sDUSfLE1KI5p mxPg== 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 header.b=QjNe8fnl; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a170902e94500b00186748fe8e8si2551874pll.188.2022.11.11.06.34.30; Fri, 11 Nov 2022 06:34:44 -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 header.b=QjNe8fnl; 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 + 91 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 Content-Type: text/plain; charset=UTF-8 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 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 *