Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp384271pxt; Thu, 12 Aug 2021 00:17:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYrNRJYF1OJ+2uKIvnIl83qW5vf36c3tQ4gQqc0K65OrYgs5cr/d4mQAATL7diSwx2qN/z X-Received: by 2002:a05:6402:34c4:: with SMTP id w4mr3736962edc.67.1628752638454; Thu, 12 Aug 2021 00:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628752638; cv=none; d=google.com; s=arc-20160816; b=NLk82qPkxQFoV/AJrKNZZeHbqCqTqckbktF9SpiDPutewIih+nKaS/xfgt9HrUXFCB S17ThBFs+eyUwhiFi/pnEYEC9bAEzRtCuFbJ7cDJCq/6G93fOOUXGwfXdkqLnjWWIXj/ KUPVTdaW8tFzZj2SbnmLfk4RG3MeZ7r8Myh1+k5qN2XjhVHQ6rMh0rvG/KA0NBKfa+35 OyqskBl4cmRubjzdTpcTgWHm5X6dspwHp0FcihyxHG1ZC6xkEROVZJ2AZVBP7ntKO9lp EgP+Y2Q7GtAS6cTDx7zey5ErFOQz0oJHUdUufCdYlFpGEOpbz44bSFYgU7gLpV4skwDV JuYA== 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=wSU10qT3DMgVSNGe799XJTHSBdCa03pVioh4XAXxAkg=; b=n9KZ+0Wapb0N67nxVmq2ZUe/sqpVP04sVBKNVozMmi7wxDcZSoJak/S5yT+NAxMNUD qTT1Jj683+/qciAo+9sYzhbp9UpUL5qIJTptQeFSqwZoUO/kayPoyN7S57tmS1LSvkCd PO3lPz7XfCniViA6gtYQwQ1ps6QY49v1yk2iOEL3ZcnrFQAlJ875GXcceFQVV8usKBE9 sYilsDF+saG46vZbZMQtCVe7eiilqFWWAzhtJj7K6r/lYJal8o+SOaT0H+gW5EWeFxJJ nl82+fn6LhqshCB8WDEsoJOnTbeuNUtZkgKpHatIsdighuorYWJThIZ9WtuO9p4QPH4D LEsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=heJv2+bo; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si1771486ejb.8.2021.08.12.00.16.54; Thu, 12 Aug 2021 00:17:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=heJv2+bo; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234723AbhHLHOW (ORCPT + 99 others); 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);