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 9A7EAC432BE for ; Thu, 12 Aug 2021 07:13:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F53B6109F for ; Thu, 12 Aug 2021 07:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234744AbhHLHOW (ORCPT ); Thu, 12 Aug 2021 03:14:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234722AbhHLHOV (ORCPT ); Thu, 12 Aug 2021 03:14:21 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF06C061765 for ; Thu, 12 Aug 2021 00:13:56 -0700 (PDT) Date: Thu, 12 Aug 2021 07:13:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628752434; 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=wSU10qT3DMgVSNGe799XJTHSBdCa03pVioh4XAXxAkg=; b=heJv2+boZqbvn1nFwB4+ZBSaaM5Vy80L8bIEM+rsb1HGW3WxxeOkt0pjdJdFPqY98JA5vD oG2xoL7mm+cn+UVnDmi8bORvsOkWGoEHFyyOW6ImxXA6a5zVxt7Ij2J44FYYoSTfP6rZFr qspTeGho1333ijOshtbsRVNvmxXKsek4Sl/avdrm2I+KaKUQRkwhAolKQ+Hg1zhLJsP6wh pxSTR2MR5MYuVrkiznoOcBtYK9mQNt2+L1v08CRPkFxKrse1VYRD79KUbPob/aDTPrIAHu 9eUeWfsAfrkJHJY3RFPF5sQQxLDBlUe7i9VW2dMBfZugr/Y+EwZycGoBkzRRLA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628752434; 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=wSU10qT3DMgVSNGe799XJTHSBdCa03pVioh4XAXxAkg=; b=74b/qbFksF3HxlcxcxR1Rl7z4QShSx581P6rCsIHoqfE3dRF3Lmc0kPadFI8OWipJ1gDAL aTDS115DJKVWyXCA== From: "irqchip-bot for James Morse" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/gic-v3: Add __gic_get_ppi_index() to find the PPI number from hwirq Cc: James Morse , Valentin Schneider , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20210729172748.28841-2-james.morse@arm.com> References: <20210729172748.28841-2-james.morse@arm.com> MIME-Version: 1.0 Message-ID: <162875243344.395.15450411113319650076.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 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: bfa80ee9ce6e2f18da76459c3dd7b0ad57fb2c20 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/bfa80ee9ce6e2f18da76459c3dd7b0ad57fb2c20 Author: James Morse AuthorDate: Thu, 29 Jul 2021 17:27:47 Committer: Marc Zyngier CommitterDate: Thu, 12 Aug 2021 08:11:03 +01:00 irqchip/gic-v3: Add __gic_get_ppi_index() to find the PPI number from hwirq gic_get_ppi_index() is a useful concept for ppi partitions, as the GIC has two PPI ranges but needs mapping to a single range when used as an index in the gic_data.ppi_descs[] array. Add a double-underscore version which takes just the intid. This will be used in the partition domain select and translate helpers to enable partition support for the EPPI range. Signed-off-by: James Morse Reviewed-by: Valentin Schneider Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210729172748.28841-2-james.morse@arm.com --- drivers/irqchip/irq-gic-v3.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index e0f4deb..b24f0a9 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -446,18 +446,23 @@ static void gic_irq_set_prio(struct irq_data *d, u8 prio) writeb_relaxed(prio, base + offset + index); } -static u32 gic_get_ppi_index(struct irq_data *d) +static u32 __gic_get_ppi_index(irq_hw_number_t hwirq) { - switch (get_intid_range(d)) { + switch (__get_intid_range(hwirq)) { case PPI_RANGE: - return d->hwirq - 16; + return hwirq - 16; case EPPI_RANGE: - return d->hwirq - EPPI_BASE_INTID + 16; + return hwirq - EPPI_BASE_INTID + 16; default: unreachable(); } } +static u32 gic_get_ppi_index(struct irq_data *d) +{ + return __gic_get_ppi_index(d->hwirq); +} + static int gic_irq_nmi_setup(struct irq_data *d) { struct irq_desc *desc = irq_to_desc(d->irq);