From patchwork Sun Jun 23 15:18:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 13708689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2774C2BBCA for ; Sun, 23 Jun 2024 16:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Content-Type: MIME-Version:References:Subject:Cc:To:From:Message-ID:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: List-Owner; bh=59dcuDVkCT5Chz9zL5I9sLuOHXcs5MQeEAa79Mp3gLM=; b=JxsbYiAcUaZiy9 JnNqH1CR5oNqde/sgPk6vJ5wWJMuoRNQXtdckmLxdpI+SynxgPTKnoXHdvrM5/g7/RSpVzOsTnJac GhbEYjZDbwsl4F3KswWPw9iHNXIo1nHktxMH9e2oX5ONmDOrQL6pyc9+TuDqsSntuvRQLReMdBnOD E5ZjfaO24vHeyvTEk3qXLVxswKjohwVexV98/mkczLUcKOzRUZgPg+U6dnOiIn4UaLDZdX2vfvAvj txeGHSPKo9GYSFvv/k943sB2um8gTSzIx5bLFeYTjJgkpG8vKJUC3ec5iKUpqzCq8BCFQaQKszLUf LPFMRF4QX7YAp50ziiOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLQ6g-0000000ENZu-0N4S; Sun, 23 Jun 2024 16:30:22 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLOzI-0000000EGDY-0Jro for linux-arm-kernel@lists.infradead.org; Sun, 23 Jun 2024 15:19:00 +0000 Message-ID: <20240623142234.964056815@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719155918; 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=59dcuDVkCT5Chz9zL5I9sLuOHXcs5MQeEAa79Mp3gLM=; b=pZzYjnwCri+KShtZdmEhjKFruhxMqQ1wW0Jm3bYWHF/6BafvSmSc7CEivG1OP7+ZrjHnXS tIRueA3Fb2CAS0oTABkZpGiMZcw27l7OrmAsVRCzXXbskMPZqcIq4wqNUO/ShniAO0Tdi7 7PuEK2msEkbbKUzdEtkBJJ2mjRLCvKBvfuh/YiB9TjCpWfOO0/891Jjr2TAIbKO+h3NV0A FJcvAWNW+dxYHHzXByrK7bCx09e3T+a5VnxojxIsZy5/v5DNeZwcsDJBrI4DxoqHAxzCtV 0l7yV5K31D2Cf7Fmrr2Wk9vzIaFA88m3Rb13x4m8Uo6HA0jUfOHo2ygRBRKB6g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719155918; 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=59dcuDVkCT5Chz9zL5I9sLuOHXcs5MQeEAa79Mp3gLM=; b=JigPkwZlluaO8jGNdKy3BRMcXC22rwWZufmZ+LsgrnmVo/FuWvc914anaBxzk5yiyI85Ka EQaWrVziOc0lTnDQ== From: Thomas Gleixner To: LKML Cc: linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, maz@kernel.org, tglx@linutronix.de, anna-maria@linutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, bhelgaas@google.com, rdunlap@infradead.org, vidyas@nvidia.com, ilpo.jarvinen@linux.intel.com, apatel@ventanamicro.com, kevin.tian@intel.com, nipun.gupta@amd.com, den@valinux.co.jp, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, gregkh@linuxfoundation.org, rafael@kernel.org, alex.williamson@redhat.com, will@kernel.org, lorenzo.pieralisi@arm.com, jgg@mellanox.com, ammarfaizi2@gnuweeb.org, robin.murphy@arm.com, lpieralisi@kernel.org, nm@ti.com, kristo@kernel.org, vkoul@kernel.org, okaya@kernel.org, agross@kernel.org, andersson@kernel.org, mark.rutland@arm.com, shameerali.kolothum.thodi@huawei.com, yuzenghui@huawei.com, shivamurthy.shastri@linutronix.de Subject: [patch V4 04/21] irqchip/irq-msi-lib: Prepare for PCI MSI/MSIX References: <20240623142137.448898081@linutronix.de> MIME-Version: 1.0 Date: Sun, 23 Jun 2024 17:18:38 +0200 (CEST) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240623_081842_438314_26FA1BEB X-CRM114-Status: GOOD ( 11.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thomas Gleixner Add the bus tokens for DOMAIN_BUS_PCI_DEVICE_MSI and DOMAIN_BUS_PCI_DEVICE_MSIX to the common child init function. Provide the match mask which can be used by parent domain implementation so the bitmask based child bus token match works. Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Behnsen Signed-off-by: Shivamurthy Shastri Signed-off-by: Thomas Gleixner --- v3: removed pci_device_msi_mask_unmask_parent_enable call as there is no more global static key. --- drivers/irqchip/irq-msi-lib.c | 6 ++++++ drivers/irqchip/irq-msi-lib.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/irqchip/irq-msi-lib.c b/drivers/irqchip/irq-msi-lib.c index acbccf8f7f5b..0b359c5d8c6c 100644 --- a/drivers/irqchip/irq-msi-lib.c +++ b/drivers/irqchip/irq-msi-lib.c @@ -48,6 +48,12 @@ bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain, /* Is the target domain bus token supported? */ switch(info->bus_token) { + case DOMAIN_BUS_PCI_DEVICE_MSI: + case DOMAIN_BUS_PCI_DEVICE_MSIX: + if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_PCI_MSI))) + return false; + + break; default: /* * This should never be reached. See diff --git a/drivers/irqchip/irq-msi-lib.h b/drivers/irqchip/irq-msi-lib.h index f0706cc28264..525aa5284a99 100644 --- a/drivers/irqchip/irq-msi-lib.h +++ b/drivers/irqchip/irq-msi-lib.h @@ -9,6 +9,12 @@ #include #include +#ifdef CONFIG_PCI_MSI +#define MATCH_PCI_MSI BIT(DOMAIN_BUS_PCI_MSI) +#else +#define MATCH_PCI_MSI (0) +#endif + int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec, enum irq_domain_bus_token bus_token);