Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6364720rwb; Mon, 5 Dec 2022 11:13:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf4AJOHNR1fs3MYNkdiVCBTNhaBKKU8f4A+sWT0SOMQevddnSLjrBFjzIlEszVY2InNjr/EI X-Received: by 2002:a17:902:ab5c:b0:189:97e2:ab8b with SMTP id ij28-20020a170902ab5c00b0018997e2ab8bmr35107421plb.131.1670267608731; Mon, 05 Dec 2022 11:13:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670267608; cv=none; d=google.com; s=arc-20160816; b=fpHqLYUYRsEzFOnnmEQS3bXXH02y8Pc0vcrqHXzLWkmSKtvYxqYqeVsvTZ8BFLTcpl NMzqhTZl+OgIIGnnxj+IOYS/+HCATYqL4JyBMofvOtt11BCBttFkc0imUAkvAsth78oC nBL0gSdrF0xOaF6W1S42+cp4t/Umh2X/ALSXnxInLN+QMkFDEALM2nyWgkAwwREvREDN UgiPsS+ngLtzOS/rSW878zuCt14KX/EidW+egBaPPONMVKZHN4rzQZc828Q5fUWc9AnV B+z4RNsEiuhjcYmx9mBAFpZ75pyJgfwhp1Ui7/56gWDM/F+8yN5EdTSWGT5cWItoB2qT fmFQ== 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=a6lgWraUK0O+Un0Ey0jc2BOkuVZzIzpe+yTTWTlh7vM=; b=VXFZ40JnPfHS3iNbo1wpqFOhAXLkzSudTkC0/TysnaeaDsJJkDCXktZMfsS99UmcMi z1lV/kASdHxLM+tk2mJjh63zQ1y42n+yl7BiI0uVxsW4gAOTud7OPVN6Aen81T2WRviO Hz5NPvBGTTl4/dFbELBT/Dz7xQJSGLYQR2KihOm0WmznG7dm7C6g3x7yKarAOPNLy9Mb Mapq0nttwtBmUj1kthaufIlg0O/XT67B2+Pfmhb25T1AmfZ1+uAkzwrqFsSMGIVB7+eZ 4Xqu0alv7HxtgzigWefIPpfANmtbV3M+MDH5ezvA+Yvms/OpCGaQoaZnxxo2Y1OVo5cf KKRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PMml47iC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 y17-20020a170902b49100b001865dfb6774si9422348plr.458.2022.12.05.11.13.17; Mon, 05 Dec 2022 11:13:28 -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=PMml47iC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S232784AbiLES1i (ORCPT + 81 others); Mon, 5 Dec 2022 13:27:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232515AbiLESZU (ORCPT ); Mon, 5 Dec 2022 13:25:20 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1013209B9; Mon, 5 Dec 2022 10:25:18 -0800 (PST) Date: Mon, 05 Dec 2022 18:25:17 -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=a6lgWraUK0O+Un0Ey0jc2BOkuVZzIzpe+yTTWTlh7vM=; b=PMml47iC+zWXbEmElvo0HReiaBw8Jo3TEXxuc0PJSGlyGFSkDWcWk28qobNT0H6GYLpNu+ z4ZHDYNA4hwaXab6x3qDDOt9mXDbKC6IQEFsyYWMb40driC96uLCdUyYOjhjpZXrne79iE BpZ6+6dvhXB1b7XbAnsGlB/py8vtiiTEWJa0zJgPuw0TmdWTt1Niet+moLH6SsuB/RV3fc aVAICh4D+I7TzrwCmyTptnRHyzGJyDNRdc7ruXw0zyb+dxiY5b4g5uBeNa6gq6xdtQfldE +k80imGFOyXHzyg8hQkIl+NZFdLPWPjdQsLpg2RqgZ4+siOMU3JI7nVMq+iUrA== 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=a6lgWraUK0O+Un0Ey0jc2BOkuVZzIzpe+yTTWTlh7vM=; b=p7uwjYV/8OKstei4oNi8c8ekHNC59EXlhJCHsQe0VcQn8NoN+it49uVjaO5KXSs5z2BsX9 SbTnOsOJh5sHaeCw== 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: Rearrange MSI domain flags Cc: Thomas Gleixner , Jason Gunthorpe , Kevin Tian , Marc Zyngier , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221124232325.322714918@linutronix.de> References: <20221124232325.322714918@linutronix.de> MIME-Version: 1.0 Message-ID: <167026471726.4906.7224680850415194332.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 The following commit has been merged into the irq/core branch of tip: Commit-ID: 2d958b02b04f18955b0e15eda531461153c399d4 Gitweb: https://git.kernel.org/tip/2d958b02b04f18955b0e15eda531461153c399d4 Author: Thomas Gleixner AuthorDate: Fri, 25 Nov 2022 00:25:46 +01:00 Committer: Thomas Gleixner CommitterDate: Mon, 05 Dec 2022 19:21:01 +01:00 genirq/msi: Rearrange MSI domain flags These flags got added as necessary and have no obvious structure. For feature support checks and masking it's convenient to have two blocks of flags: 1) Flags to control the internal behaviour like allocating/freeing MSI descriptors. Those flags do not need any support from the underlying MSI parent domain. They are mostly under the control of the outermost domain which implements the actual MSI support. 2) Flags to expose features, e.g. PCI multi-MSI or requirements which can depend on a underlying domain. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20221124232325.322714918@linutronix.de --- include/linux/msi.h | 49 ++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/include/linux/msi.h b/include/linux/msi.h index 43b8866..a4339eb 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -24,6 +24,8 @@ #include #include #include +#include + #include /* Dummy shadow structures if an architecture does not define them */ @@ -440,7 +442,16 @@ struct msi_domain_info { void *data; }; -/* Flags for msi_domain_info */ +/* + * Flags for msi_domain_info + * + * Bit 0-15: Generic MSI functionality which is not subject to restriction + * by parent domains + * + * Bit 16-31: Functionality which depends on the underlying parent domain and + * can be masked out by msi_parent_ops::init_dev_msi_info() when + * a device MSI domain is initialized. + */ enum { /* * Init non implemented ops callbacks with default MSI domain @@ -452,33 +463,41 @@ enum { * callbacks. */ MSI_FLAG_USE_DEF_CHIP_OPS = (1 << 1), - /* Support multiple PCI MSI interrupts */ - MSI_FLAG_MULTI_PCI_MSI = (1 << 2), - /* Support PCI MSIX interrupts */ - MSI_FLAG_PCI_MSIX = (1 << 3), /* Needs early activate, required for PCI */ - MSI_FLAG_ACTIVATE_EARLY = (1 << 4), + MSI_FLAG_ACTIVATE_EARLY = (1 << 2), /* * Must reactivate when irq is started even when * MSI_FLAG_ACTIVATE_EARLY has been set. */ - MSI_FLAG_MUST_REACTIVATE = (1 << 5), - /* Is level-triggered capable, using two messages */ - MSI_FLAG_LEVEL_CAPABLE = (1 << 6), + MSI_FLAG_MUST_REACTIVATE = (1 << 3), /* Populate sysfs on alloc() and destroy it on free() */ - MSI_FLAG_DEV_SYSFS = (1 << 7), - /* MSI-X entries must be contiguous */ - MSI_FLAG_MSIX_CONTIGUOUS = (1 << 8), + MSI_FLAG_DEV_SYSFS = (1 << 4), /* Allocate simple MSI descriptors */ - MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS = (1 << 9), + MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS = (1 << 5), /* Free MSI descriptors */ - MSI_FLAG_FREE_MSI_DESCS = (1 << 10), + MSI_FLAG_FREE_MSI_DESCS = (1 << 6), /* * Quirk to handle MSI implementations which do not provide * masking. Currently known to affect x86, but has to be partially * handled in the core MSI code. */ - MSI_FLAG_NOMASK_QUIRK = (1 << 11), + MSI_FLAG_NOMASK_QUIRK = (1 << 7), + + /* Mask for the generic functionality */ + MSI_GENERIC_FLAGS_MASK = GENMASK(15, 0), + + /* Mask for the domain specific functionality */ + MSI_DOMAIN_FLAGS_MASK = GENMASK(31, 16), + + /* Support multiple PCI MSI interrupts */ + MSI_FLAG_MULTI_PCI_MSI = (1 << 16), + /* Support PCI MSIX interrupts */ + MSI_FLAG_PCI_MSIX = (1 << 17), + /* Is level-triggered capable, using two messages */ + MSI_FLAG_LEVEL_CAPABLE = (1 << 18), + /* MSI-X entries must be contiguous */ + MSI_FLAG_MSIX_CONTIGUOUS = (1 << 19), + }; int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,