From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3D11C433FE for ; Fri, 11 Dec 2020 15:28:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 79B4222D72 for ; Fri, 11 Dec 2020 15:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437262AbgLKPAf (ORCPT ); Fri, 11 Dec 2020 10:00:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406402AbgLKO7c (ORCPT ); Fri, 11 Dec 2020 09:59:32 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2B6DC061793 for ; Fri, 11 Dec 2020 06:58:44 -0800 (PST) Date: Fri, 11 Dec 2020 14:58:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607698723; 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=lbCPyRP6ce6sQFOLWTVg+XQPTCDxCL62hdbB02SSOTg=; b=yRXb10e713J/MQ/zZCWzuwLbCPU2Yhh5pvTrvHRLC+zQdr9m/iwgQj93RGcEGzJgq3i4rF HJXn0UeyClOWuK5xyRvWXPb+K4l7yXMLCkueXzj3NF+6fVaGWxJNVXSFnbWXbQ8dr26sec K8JB+77dnZvcimw9Lv77fuLgyaR9n6v+ZHjYJGUPbkzaFFkIqhfEregGj3Hw61j8dnt0tq rbVVpiLRR0kTkk85tIdpvuQk75Z2E3rOaxim74q0k3AR5L6J+e0NiGmtP/wbRrT2cKsgmg 2J4DcPUmTaWHelo6aHYTiiVnOupuRMPN0ln7qITz2FDjgXKxTYZBg0kzYH1D1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607698723; 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=lbCPyRP6ce6sQFOLWTVg+XQPTCDxCL62hdbB02SSOTg=; b=GGTi4S9mGLsFjnOumaSYOBwE5QYutMgV7gfwPEGh0umQstSu5VMpL30yED7lunZpJIYgow NERnnVXmejv1X/Bg== From: "irqchip-bot for Marc Zyngier" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] platform-msi: Track shared domain allocation Cc: Marc Zyngier , John Garry , tglx@linutronix.de In-Reply-To: <20201129135208.680293-2-maz@kernel.org> References: <20201129135208.680293-2-maz@kernel.org> MIME-Version: 1.0 Message-ID: <160769872273.3364.3717006232182382204.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: Yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 91f90daa4fb2b77db7aa25ef2e0206f2e3962665 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/91f90daa4fb2b77db7aa25ef2e0206f2e3962665 Author: Marc Zyngier AuthorDate: Sun, 29 Nov 2020 13:52:06 Committer: Marc Zyngier CommitterDate: Fri, 11 Dec 2020 14:47:50 platform-msi: Track shared domain allocation We have two flavours of platform-MSI: - MSIs generated by devices for themselves (the usual case) - MSIs generated on behalf of other devices, as the generating device is some form of bridge (either a wire-to-MSI bridge, or even a non-transparent PCI bridge that repaints the PCI requester ID). In the latter case, the underlying interrupt architecture may need to track this in order to keep the mapping alive even when no MSI are currently being generated. Add a set of flags to the generic msi_alloc_info_t structure, as well as the MSI_ALLOC_FLAGS_PROXY_DEVICE flag that will get advertized by the platform-MSI code when allocating an irqdomain for a device. Signed-off-by: Marc Zyngier Tested-by: John Garry Link: https://lore.kernel.org/r/20201129135208.680293-2-maz@kernel.org --- drivers/base/platform-msi.c | 7 +++++++ include/asm-generic/msi.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c index c4a17e5..2c1e2e0 100644 --- a/drivers/base/platform-msi.c +++ b/drivers/base/platform-msi.c @@ -59,9 +59,15 @@ static int platform_msi_init(struct irq_domain *domain, return irq_domain_set_hwirq_and_chip(domain, virq, hwirq, info->chip, info->chip_data); } + +static void platform_msi_set_proxy_dev(msi_alloc_info_t *arg) +{ + arg->flags |= MSI_ALLOC_FLAGS_PROXY_DEVICE; +} #else #define platform_msi_set_desc NULL #define platform_msi_init NULL +#define platform_msi_set_proxy_dev(x) do {} while(0) #endif static void platform_msi_update_dom_ops(struct msi_domain_info *info) @@ -343,6 +349,7 @@ __platform_msi_create_device_domain(struct device *dev, if (!domain) goto free_priv; + platform_msi_set_proxy_dev(&data->arg); err = msi_domain_prepare_irqs(domain->parent, dev, nvec, &data->arg); if (err) goto free_domain; diff --git a/include/asm-generic/msi.h b/include/asm-generic/msi.h index e6795f0..1010e74 100644 --- a/include/asm-generic/msi.h +++ b/include/asm-generic/msi.h @@ -22,12 +22,16 @@ struct msi_desc; typedef struct msi_alloc_info { struct msi_desc *desc; irq_hw_number_t hwirq; + unsigned long flags; union { unsigned long ul; void *ptr; } scratchpad[NUM_MSI_ALLOC_SCRATCHPAD_REGS]; } msi_alloc_info_t; +/* Device generating MSIs is proxying for another device */ +#define MSI_ALLOC_FLAGS_PROXY_DEVICE (1UL << 0) + #define GENERIC_MSI_DOMAIN_OPS 1 #endif