Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4514595imw; Tue, 19 Jul 2022 08:03:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uzOaybx0V5Pcm+0uQkuQupIvWSAinbIBkd8WDUEFIZN/nieatNWCwQ6mODm/zRE7Q9UsoK X-Received: by 2002:a05:6870:f2a0:b0:fe:29a0:4b48 with SMTP id u32-20020a056870f2a000b000fe29a04b48mr17806561oap.183.1658242998920; Tue, 19 Jul 2022 08:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658242998; cv=none; d=google.com; s=arc-20160816; b=p0r5XsZ028+mb3iyuC1gaeoLO4a4nbXpd34dEGOQoO/qtISLQ18lOuqZMACVColiI7 Nmc9bmi5De4R7Wn6YjaQcAG4pWLSYuyziINpfQShBSjHedsaXkWBAfms6MKDqj4aJT9j i9MZgfDm7UjuhZ6iYCCXm1/1J8d0u1fnN7+aY8xxwylXh9ISyRrxI42NNJm8jGR/760q lr7OJZTB6NGUcZp8ZfjUgyiEBCW6X+jZkKzd9kBzO3w8IrLBBEdS/FCFueDEoaD8uC4D 3PQNy3K+xm2zLz1bbgh06D+dzCk5ODl8CVvg9xkLNDWkpYug64TQTxDEBJagyVhefv52 TqvA== 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=u0Z032i2fbmIcavT6MKuRkssXwrodwgFJfgRl0JPKHQ=; b=t9YHCZMLeyweH26P4Z9PdXKr90be4uEreEdKRYBZBewYDPmm/+3BnlV2Uu+4o2NwfS MIEzj1MP6t7o/P9olalmU0SWkZp38QsLZgz7XgfscQ6RwHcJXTPY8nZk4f4b9h39+Shi Z0gjrJAUp/XCFbBU7JIYAHJuert4D7+yG5hJEGtMx3LRBMJ+iuzLeMWk+a5l04LM+rq2 lEOp554I0wqyzMH4qlYyRDxuUHLzJE5JPvRPuWECNhB+sO/MuWl8QrUWA+5jGSpl9txC 1V5hWoJ+PpNuF1a98sjSRw7gR66iaLbK8IrE2Wv9v65VAiPZ2x0RhmoIjWL4cHuKUpBp 6bXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=tpYg8B3O; 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 z16-20020a056870c21000b0010c1d16b0f9si14337767oae.307.2022.07.19.08.02.54; Tue, 19 Jul 2022 08:03:18 -0700 (PDT) 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=tpYg8B3O; 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 S237574AbiGSOTi (ORCPT + 99 others); Tue, 19 Jul 2022 10:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235113AbiGSOS7 (ORCPT ); Tue, 19 Jul 2022 10:18:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F48D7F52D for ; Tue, 19 Jul 2022 06:55:51 -0700 (PDT) Date: Tue, 19 Jul 2022 13:55:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1658238949; 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=u0Z032i2fbmIcavT6MKuRkssXwrodwgFJfgRl0JPKHQ=; b=tpYg8B3OMFF1RXppKC6vtw4EWHwLe/KGxC6aKEuaD36k7/QBbfNmUoP//eQdmO3B1qykWr mYSSsQomo17OkDtY/I95DIoTD8kE906Crdggxzga8PceQcvtjYgJrQ7OXKFJJTS/VFRS5A hPpOQbvGVzs797FUNb92zdLz0jzhyx2C2ex36rrcqEynAe3Mv32yXOoOrvN4hXBKNnmPBw ho2+ujcdRLq3GPFEZ0L6BkuTtKF2gOzBTzRCKkg+tjLSDhHGzU/5yUy087K9eLYUVmDeRI 5QB9vhHGDW08IOaldjDAHtBUksiGeilVuy1Jme91zNy56vKHiy5xzcLnXArh/A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1658238949; 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=u0Z032i2fbmIcavT6MKuRkssXwrodwgFJfgRl0JPKHQ=; b=1OWiWy0HbhCOQ0T3aXT4zWWfrLy3BaidMgnJVDUNjyOH6wzTk1YJ3peOh5wDDvpqHGQMEq t8JxdoF/JunbR6Cw== From: "irqchip-bot for Xu Qiang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqdomain: Use hwirq_max instead of revmap_size for NOMAP domains Cc: Xu Qiang , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20220719063641.56541-3-xuqiang36@huawei.com> References: <20220719063641.56541-3-xuqiang36@huawei.com> MIME-Version: 1.0 Message-ID: <165823894768.15455.2097114111818938534.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/irqchip-next branch of irqchip: Commit-ID: ef50cd57a73a8bbfad403e5e2edb3309611f58ad Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/ef50cd57a73a8bbfad403e5e2edb3309611f58ad Author: Xu Qiang AuthorDate: Tue, 19 Jul 2022 06:36:41 Committer: Marc Zyngier CommitterDate: Tue, 19 Jul 2022 14:51:56 +01:00 irqdomain: Use hwirq_max instead of revmap_size for NOMAP domains NOMAP irq domains use the revmap_size field to indicate the maximum hwirq number the domain accepts. This is a bit confusing as revmap_size is usually used to indicate the size of the revmap array, which a NOMAP domain doesn't have. Instead, use the hwirq_max field which has the correct semantics, and keep revmap_size to 0 for a NOMAP domain. Signed-off-by: Xu Qiang [maz: commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220719063641.56541-3-xuqiang36@huawei.com --- kernel/irq/irqdomain.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 481abb8..8fe1da9 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -147,7 +147,8 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, unsigned int s static atomic_t unknown_domains; if (WARN_ON((size && direct_max) || - (!IS_ENABLED(CONFIG_IRQ_DOMAIN_NOMAP) && direct_max))) + (!IS_ENABLED(CONFIG_IRQ_DOMAIN_NOMAP) && direct_max) || + (direct_max && (direct_max != hwirq_max)))) return NULL; domain = kzalloc_node(struct_size(domain, revmap, size), @@ -219,7 +220,6 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, unsigned int s domain->hwirq_max = hwirq_max; if (direct_max) { - size = direct_max; domain->flags |= IRQ_DOMAIN_FLAG_NO_MAP; } @@ -650,9 +650,9 @@ unsigned int irq_create_direct_mapping(struct irq_domain *domain) pr_debug("create_direct virq allocation failed\n"); return 0; } - if (virq >= domain->revmap_size) { - pr_err("ERROR: no free irqs available below %i maximum\n", - domain->revmap_size); + if (virq >= domain->hwirq_max) { + pr_err("ERROR: no free irqs available below %lu maximum\n", + domain->hwirq_max); irq_free_desc(virq); return 0; } @@ -906,7 +906,7 @@ struct irq_desc *__irq_resolve_mapping(struct irq_domain *domain, return desc; if (irq_domain_is_nomap(domain)) { - if (hwirq < domain->revmap_size) { + if (hwirq < domain->hwirq_max) { data = irq_domain_get_irq_data(domain, hwirq); if (data && data->hwirq == hwirq) desc = irq_data_to_desc(data);