From patchwork Mon Nov 21 14:36:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 23796 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1626589wrr; Mon, 21 Nov 2022 06:37:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf4W5xDglcAoMy17j0F4Oka7cNj/L1KADI+3KRttXHiLu4Fcq/NSaDp8ozELbU09L2DhLyme X-Received: by 2002:a63:5544:0:b0:477:6fe2:c1d1 with SMTP id f4-20020a635544000000b004776fe2c1d1mr4775207pgm.444.1669041477563; Mon, 21 Nov 2022 06:37:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669041477; cv=none; d=google.com; s=arc-20160816; b=y/52aFJwlt/DFfRcQXYrnlnK8vcoHG/Tfm4z/bSeLDW20UC89HlziAH9Ved2p3Y41q S7nHbutUakUElMRURgoz2UzWjP0ohCtqjiWUxrs7f12qmfJNkcXFtkLUgPqF3qc5OIH5 b2xanEflve9ZgdnC4A+jPtznAxqNGW4/AtHhWsbla95ypn8czuIQeYFfaEezS951pwVN 7e9UHUWKdXAIR4RwB3qorUVTBQUYHDnsOG0hYtyrjXND5nDs0zKPxMWP1osletRLllqH /QtkHJ7IdyjI06GyGxSIn1sXXvMZ/HYQw9DU8hPaT2TIaNOC2Yb1YYuHMJ7595LTkMaC vI9g== 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=+CkTPHTMXOvRSl4YB673TzHqsVFLjHUDowE8deLkwuw=; b=mTBmntqHAZlBEfFTXNCL9YZdA4Z7JjKfnrumOeq+MGsRYZgIpdGU4qmLxZRRxKHTzB muZAHF6fEQFTMm2AWd4ZZEmMZvxgIqRdLOBPWYuHemSDU8TwFOtszYQwnVwrJkTauU+x co1+pPdFX/yzbr5kdBUQTe9QaXN8Ww25f4w1XLn0SYnwwq4NsEfdMD3hxv7PtJEGQjG5 WBUTIJ/kXpDZPgNvmRgG6tBRJiZRk6VMsi/JaqUHNPHF5pJTwYc8OnmQFBemZHaIyrb4 bxI9nzXqBrrwsGb3cau+JP5SAplMS5d1m/EWmk0Jg1TpYo+7GpfHgIQINu8mPlN9dbiU 0f9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zV8w1tsS; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a656944000000b0045ceafe40cesi10230977pgq.395.2022.11.21.06.37.43; Mon, 21 Nov 2022 06:37:57 -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=zV8w1tsS; 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 S231292AbiKUOhU (ORCPT + 99 others); Mon, 21 Nov 2022 09:37:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231262AbiKUOgl (ORCPT ); Mon, 21 Nov 2022 09:36:41 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9362C6D11; Mon, 21 Nov 2022 06:36:27 -0800 (PST) Message-ID: <20221121083325.846660254@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669041386; 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=+CkTPHTMXOvRSl4YB673TzHqsVFLjHUDowE8deLkwuw=; b=zV8w1tsStuX6XpptBJYxfR/+top3jj9uLazwOM4LRF4mOE0WH71cTpcWF13zcM9azFKYGG n/NlPSy3li4+/81QJ7uLjbotwoeDCCkqcKocTWCJCZj8wCvqAfvFrFR3Ebo46e4tmuN5M9 coCDxseOpxTiaFZaPqh1yomqRBzLa9bk4GZiP6E3hRq3BlGNMkCYMhbUc5Q8S92nf8Ioka 1U2niNxlRISp2fhx/2JbGRCxyq+JdehVWrc2aBpNTspddQZvlGLgEgFuthyIAjH9kHqp/e //M9aKh3z2LcrtbCvHWpw/U/a18yIoikzOq6omMcr41tPkURgtyEEFeCoYMFKQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669041386; 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=+CkTPHTMXOvRSl4YB673TzHqsVFLjHUDowE8deLkwuw=; b=Dy8ze2Ov2RrLoLEbR8EjWXrxDOY3VkF3/JAWrN7RTBPFmdy+I9uhjCYlI5C59VeO8E1J1u t71IP+PC25I8S5Dg== 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 Subject: [patch V2 06/21] genirq/irqdomain: Provide IRQ_DOMAIN_FLAG_MSI_DEVICE References: <20221121083210.309161925@linutronix.de> MIME-Version: 1.0 Date: Mon, 21 Nov 2022 15:36:25 +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?1750116836198276992?= X-GMAIL-MSGID: =?utf-8?q?1750116836198276992?= Similar to marking parent MSI domains it's required to identify per device domains. Add flag and helpers. Signed-off-by: Thomas Gleixner --- include/linux/irqdomain.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -192,6 +192,9 @@ enum { /* Irq domain is a MSI parent domain */ IRQ_DOMAIN_FLAG_MSI_PARENT = (1 << 8), + /* Irq domain is a MSI device domain */ + IRQ_DOMAIN_FLAG_MSI_DEVICE = (1 << 9), + /* * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved * for implementation specific purposes and ignored by the @@ -559,6 +562,11 @@ static inline bool irq_domain_is_msi_par return domain->flags & IRQ_DOMAIN_FLAG_MSI_PARENT; } +static inline bool irq_domain_is_msi_device(struct irq_domain *domain) +{ + return domain->flags & IRQ_DOMAIN_FLAG_MSI_DEVICE; +} + #else /* CONFIG_IRQ_DOMAIN_HIERARCHY */ static inline int irq_domain_alloc_irqs(struct irq_domain *domain, unsigned int nr_irqs, int node, void *arg) @@ -609,6 +617,11 @@ static inline bool irq_domain_is_msi_par { return false; } + +static inline bool irq_domain_is_msi_device(struct irq_domain *domain) +{ + return false; +} #endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */