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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 DC013C4338F for ; Fri, 30 Jul 2021 10:47:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB6A260FE7 for ; Fri, 30 Jul 2021 10:47:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238530AbhG3Kri (ORCPT ); Fri, 30 Jul 2021 06:47:38 -0400 Received: from foss.arm.com ([217.140.110.172]:40302 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238487AbhG3Kri (ORCPT ); Fri, 30 Jul 2021 06:47:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6D1F31FB; Fri, 30 Jul 2021 03:47:33 -0700 (PDT) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B93933F73D; Fri, 30 Jul 2021 03:47:32 -0700 (PDT) From: Valentin Schneider To: James Morse , linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Marc Zyngier Subject: Re: [PATCH 2/2] irqchip/gic-v3: Fix selection of partition domain for EPPIs In-Reply-To: <20210729172748.28841-3-james.morse@arm.com> References: <20210729172748.28841-1-james.morse@arm.com> <20210729172748.28841-3-james.morse@arm.com> Date: Fri, 30 Jul 2021 11:47:30 +0100 Message-ID: <87eebgkri5.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/07/21 17:27, James Morse wrote: > commit 5f51f803826e ("irqchip/gic-v3: Add EPPI range support") added > GIC_IRQ_TYPE_PARTITION support for EPPI to gic_irq_domain_translate(), > and commit 52085d3f2028 ("irqchip/gic-v3: Dynamically allocate PPI > partition descriptors") made the gic_data.ppi_descs array big enough for > EPPI, but neither gic_irq_domain_select() nor partition_domain_translate() > were updated. > > This means partitions are created by partition_create_desc() for the > EPPI range, but can't be registered as they will always match the root > domain and map to the summary interrupt. > > Update gic_irq_domain_select() to match PPI and EPPI. The fwspec for > PPI and EPPI both start from 0. Use gic_irq_domain_translate() to find > the hwirq from the fwspec, then convert this to a ppi index. > > Reported-by: Valentin Schneider > Signed-off-by: James Morse Tiny nit below, regardless: Reviewed-by: Valentin Schneider > @@ -1518,7 +1547,12 @@ static int partition_domain_translate(struct irq_domain *d, > if (WARN_ON(!np)) > return -EINVAL; > > - ret = partition_translate_id(gic_data.ppi_descs[fwspec->param[1]], > + ret = gic_irq_domain_translate(d, fwspec, &ppi_intid, type); This assigns @type for us, so the @type assignment at the tail of partition_domain_translate() becomes redundant. > + if (WARN_ON_ONCE(ret)) > + return 0; > + > + ppi_idx = __gic_get_ppi_index(ppi_intid); > + ret = partition_translate_id(gic_data.ppi_descs[ppi_idx], > of_node_to_fwnode(np)); > if (ret < 0) > return ret; > -- > 2.30.2